TradingView indicator guides

Elder Ray indicator: Bull Bear Power formulas and limits

The Elder Ray indicator compares each bar's high and low with an exponential moving average. Bull Power is the high minus that EMA; Bear Power is the low minus it. TradingView's combined BBP adds the two readings. These are price distances, not percentages or measured buying and selling volume.

The worked examples and Pine Script below let you inspect both components, switch to the combined histogram, and check a confirmed-bar trend filter. A positive sum alone is not a complete trading rule.

Two components, one optional sum

Alexander Elder developed the Bull Power and Bear Power oscillators. MetaTrader's documentation describes them separately, with a moving average supplying trend context. TradingView's built-in BBP combines them and uses a 13-bar EMA of closing prices by default. TradingView documents the combined calculation.

EMA = EMA(close, length)

Bull Power = high − EMA

Bear Power = low − EMA

Combined BBP = high + low − 2 × EMA

All three outputs retain the chart's price unit. They have no fixed upper or lower bound. For a valid OHLC bar, Bull Power is always at least Bear Power, since their difference equals high minus low. They can both be positive or both negative.

The combined zero line has a precise meaning: BBP = 2 × (hl2 − EMA). Cancellation occurs when the candle midpoint equals the EMA, even with a wide candle range. A Bull Power zero instead means high equals EMA; a Bear Power zero means low equals EMA.

Worked example: identical reference, different readings

These are three independent hypothetical snapshots, not consecutive bars or market observations. Each starts with an already initialized previous EMA of 100. With length 13, the smoothing factor is 2 / 14 = 1 / 7. The current EMA is previous EMA + (close − previous EMA) / 7.

Illustrative data. All numeric readings use price units.
CasePrevious EMACloseHighLowEMABullBearSum
A: cancellation10010010496100+4−40
B: rising EMA10010710999101+8−2+6
C: falling EMA100931019199+2−8−6

Case A cancels: +4 + (−4) = 0, but its range is 8. In B, EMA rises to 101 and Bear Power is −2. If the prior Bear Power was −4, the low remains below the reference while its distance has narrowed. The illustrative long filter accepts this closed bar. If prior Bear Power was −1, it rejects it despite the same +6 combined reading.

Case C reverses the logic. EMA falls to 99. Given prior Bull Power of +4, the current +2 is positive and falling, so the short filter accepts the closed bar. A flat EMA, as in A, satisfies neither directional filter.

Pine Script v6: inspect components and combined BBP

Paste the complete indicator into TradingView's Pine Editor and add it to a chart. The default display has two lines. The toggle switches to the combined histogram used by the original version of this page. Both modes calculate the same components; changing the view does not change the setup rules.

Pine Script v6
// This source code is subject to the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Pineify
//@version=6
indicator("Elder Ray: components and combined BBP", overlay=false)

length = input.int(13, "EMA length", minval=1)
showCombined = input.bool(false, "Show combined BBP instead of components")

basis = ta.ema(close, length)
bullPower = high - basis
bearPower = low - basis
bbp = bullPower + bearPower

// Illustrative one-bar trend filter; these are states, not trade orders.
longSetup = barstate.isconfirmed and basis > basis[1] and bearPower < 0 and bearPower > bearPower[1]
shortSetup = barstate.isconfirmed and basis < basis[1] and bullPower > 0 and bullPower < bullPower[1]

plot(showCombined ? na : bullPower, "Bull Power", color=color.teal, linewidth=2)
plot(showCombined ? na : bearPower, "Bear Power", color=color.red, linewidth=2)
plot(showCombined ? bbp : na, "Combined BBP", color=bbp >= 0 ? color.teal : color.red, style=plot.style_columns)
plot(basis, "EMA of close", display=display.data_window)
hline(0, "Zero", color=color.gray)
plotshape(longSetup, "Long setup state", shape.triangleup, location.bottom, color.teal, size=size.tiny)
plotshape(shortSetup, "Short setup state", shape.triangledown, location.top, color.red, size=size.tiny)
alertcondition(longSetup, "Elder Ray long setup", "Closed bar: EMA rising, Bear Power negative and rising.")
alertcondition(shortSetup, "Elder Ray short setup", "Closed bar: EMA falling, Bull Power positive and falling.")
  • Teal line: Bull Power. Red line: Bear Power. Their colors identify the series, regardless of sign.
  • Combined histogram: teal at or above zero, red below zero. Its color describes sign, not whether BBP rose from the previous bar.
  • Triangles: every confirmed bar satisfying the illustrated long or short setup. They can repeat on consecutive bars.
  • Data Window: the current EMA of close. Add an EMA with the same length and close source to the price chart for visual comparison.

Create an alert using one of the named conditions and select Once Per Bar Close. Plots still update during an open candle; the setup conditions wait for barstate.isconfirmed. The code places no orders and defines no exits.

Inputs and the trend-filter contract

SettingValueEffect
EMA length13, minimum 1Changes the reference used by both components and the trend filter.
Combined viewOffReplaces the two component lines with their sum.
EMA sourceclose, fixed in codeChanging to hl2 or another source changes the calculation.
Trend comparisonCurrent vs previous EMAOne-bar slope on the chart timeframe; not a higher-timeframe trend.

MetaTrader documents a rising trend with negative but rising Bear Power as a long condition, and the opposite pattern in Bull Power for shorts. Here, trend means a strict one-bar change in the same EMA. That is an explicit teaching choice, not a claim to reproduce every rule in Elder's trading system.

For a long setup, require EMA > prior EMA, Bear Power < 0, and Bear Power > prior Bear Power. For a short setup, require EMA < prior EMA, Bull Power > 0, and Bull Power < prior Bull Power. Evaluate all conditions on the same closed bar. Neither rule requires the combined BBP to cross zero.

With length 1, the EMA equals close: Bull Power becomes high − close and Bear Power becomes low − close. That edge case is useful for checking arithmetic, but changes the reference substantially. No best timeframe or length is established here.

Limits to check before defining a strategy

  • Keep the components when your rule depends on one extreme. A sum loses information: +8 and −2, or +10 and −4, both produce +6.
  • Use matching symbol, session, timeframe, chart type and available history. Synthetic candles change the OHLC inputs; different EMA initialization histories can affect early values.
  • Specify the signal time. The current high, low and close can change while a candle forms. A confirmed-bar condition does not provide an intrabar entry price.
  • Do not copy absolute thresholds between markets. A value of +2 has a different scale on a low-priced stock and a high-priced instrument.
  • Separate a setup from an executed trade. A backtest still needs entry timing, exits, sizing, commission and slippage. Consecutive setup bars need an explicit repeat-entry policy.

Elder Ray versus Balance of Power

Balance of Power uses (close − open) / (high − low). It is a candle-body-to-range ratio. Elder Ray uses EMA-relative price distances and does not require open or volume. A shared power label does not make these indicators interchangeable. RSI is also on a different scale: a BBP value of 70 is not an RSI overbought level.

Educational calculation examples, not investment advice. No performance, accuracy or return claim is made for the setup filters.

Turn the specification into a checkable Pineify script

Give the Pine Script AI Coding Agent the EMA source and length, component or combined display, exact filter comparisons, and confirmation time. Ask it to expose the EMA and both components before adding strategy orders.

  1. Start with close and length 13 to match this baseline.
  2. Choose separate lines or the combined sum explicitly.
  3. Specify whether a setup should repeat or trigger only on its first qualifying bar.
  4. Compare values bar by bar in TradingView's Data Window.
  5. Define exits, costs and execution assumptions separately before evaluating a strategy.
Open Pine Script AI Coding Agent

Elder Ray and BBP questions

Elder Ray uses an EMA as a reference for two price differences: Bull Power measures the high relative to that average, and Bear Power measures the low. Keeping the two readings separate shows where each extreme sits. A combined BBP histogram compresses them into one number, which can hide offsetting movements.

TradingView uses the Elder-Ray name for its Bull Bear Power indicator and displays the sum of the two components. This example defaults to separate Bull Power and Bear Power lines; its combined option displays their sum. Match the display mode before comparing values or interpreting a zero cross.

It means the high-low midpoint has moved across the EMA reference, because combined BBP equals twice the difference between that midpoint and the EMA. It does not mean the close crossed the EMA. Check the individual components if your rule depends on a low below the average or a high above it.

They use the same price units as the chart. A value of 2 on a USD-priced stock is a price distance of 2 dollars, not 2 percent or 2 contracts. A common numerical threshold across unrelated instruments has no automatic meaning. Tick size, price level and volatility affect the interpretation.

This script starts with 13 bars and fixes the EMA source to close. It establishes no best length or timeframe. Change one input at a time and compare the same symbol, session, chart type and date range. A different source or trend horizon creates a different specification and must be documented.

Copy the complete script into Pine Editor, save it, and add it to the chart. The default view has a teal Bull Power line and a red Bear Power line. Enable the combined option for a signed histogram. The Data Window also exposes the EMA. Select a named setup condition when creating an alert.

The live plots can change before the current candle closes. Setup markers and alert conditions require bar confirmation, so an intrabar candidate can disappear without a confirmed marker. The example uses only chart-timeframe prices and no future pivots. That does not protect against later data revisions or changes to chart inputs.

No. Elder Ray measures distances from an EMA in price units. Balance of Power divides the open-to-close change by the same candle range and is dimensionless. Similar names do not make their values, thresholds or zero-line conditions interchangeable.

Sources and further checks

Official references checked October 17, 2026. The numeric table is an original illustration.

Browse TradingView indicator guides