EMA-relative prices · Component sums · Signal timing
Bull Bear Power Pine Script: what the summed histogram hides
Bull Bear Power adds high minus EMA and low minus EMA. The result is twice the distance from the bar's high-low midpoint to the EMA of closes. A positive column does not establish that the close is above the average or that buying volume dominates. Inspect the two components before turning their sum into a trading condition.
Reduce the formula before interpreting its sign
Bear Power = Low − EMA(Close, N)
BBP = High + Low − 2 × EMA = 2 × (HL2 − EMA)
Both components and the sum use price units. EMA is recursive: with length 13, its update weight is 2/(13+1) = 1/7. Given previous EMA E and current close C, the new value is E + (C−E)/7. Length controls that weighting, not a hard cutoff that discards every close older than 13 bars.
| High / low / close | Current EMA | Bull / bear | BBP |
|---|---|---|---|
| 110 / 96 / 98 | 99.714286 | 10.285714 / −3.714286 | +6.571429 |
| 104 / 90 / 102 | 100.285714 | 3.714286 / −10.285714 | −6.571429 |
| 110 / 90 / 100 | 100 | 10 / −10 | 0 |
| 101 / 99 / 100 | 100 | 1 / −1 | 0 |
In the first row, close 98 is below EMA 99.714286 even though BBP is positive. In the second, close 102 is above EMA 100.285714 even though BBP is negative. In the final two rows, the sum is identical while the full range changes from 20 to 2. Zero means the midpoint equals the EMA, not that no volatility or trading occurred.
The fact that the high exceeds the EMA is necessary but not sufficient for positive BBP: the low can be sufficiently far below to outweigh it. The analogous statement applies to a low below the EMA and negative BBP. Neither component measures actual buy-initiated or sell-initiated trades.
Keep the components when the rule needs them
Two component pairs, +10/−4 and +8/−2, both sum to +6. In the second pair, Bull Power is lower while Bear Power is less negative. A rule about rising Bear Power cannot be reconstructed from the unchanged sum alone. The paired plots and summed histogram answer different questions.
MetaTrader's Bulls Power documentation attributes the high-minus-EMA component to Alexander Elder and his book Trading for a Living; its Bears Power documentation describes the low-minus-EMA component. TradingView documents BBP as their sum, with default length 13, and also uses the Elder-Ray name. Check the implementation instead of relying on a universal distinction between names.
The related BBP reference shows the separate component workflow. Balance of Power instead divides the candle body by its range; it is dimensionless. Elder-Ray components do not use volume. Force Index introduces volume multiplied by close-to-close change, while MACD compares moving averages; those different inputs do not establish a fixed ranking of their reliability.
Multiplying all historical prices by ten makes the first example's +6.571429 become +65.714286. The sign is preserved; magnitude is not comparable to an unrelated instrument's fixed threshold. A normalization needs its own denominator and zero-value policy. This page does not supply universal +1 or −1 thresholds.
The retained histogram example
This example uses chart high and low and an EMA of chart close. Its helper accepts high and low arguments, while the close used inside remains the chart close. The call fixes length at 13. There are no input declarations, strategy orders, alert conditions or divergence calculations.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Pineify
//@version=6
indicator(title="Bull Bear Power", overlay=false, max_labels_count=500)
// BBP — sums high-EMA and low-EMA to measure bull and bear dominance
// Parameters: high, low, length=13 (EMA period)
p_ta_bbp(series float highSource, series float lowSource, simple int length) =>
ema_val = ta.ema(close, length)
bullPower = highSource - ema_val
bearPower = lowSource - ema_val
bullPower + bearPower
p_ind_1_bbp = p_ta_bbp(high, low, 13) // BBP with 13-period EMA
// Zero line reference
hline(0, "BBP - Zero Line", color=color.new(#787B86, 50))
// Histogram: green when BBP positive (bulls dominant), red when negative (bears dominant)
plot(p_ind_1_bbp, title="Bull Bear Power", style=plot.style_columns,
color=p_ind_1_bbp >= 0 ? color.rgb(38, 166, 154, 0) : color.rgb(255, 82, 82, 0))
The green branch includes zero because the test is greater-than-or-equal. At exactly zero the column has no height; the reference line remains. Positive values shrinking toward zero are still positive, while negative values rising toward zero are still negative. Color describes sign, not slope. The comments' bull/bear dominance wording is shorthand for the EMA-relative price calculation, not measured order flow.
High, low and close can change while the bar is open. The histogram can cross zero and return before confirmation. There is no current-bar close gate in this example. A prior-bar reference makes the previous observation available on the next bar; it does not itself create an alert or choose alert frequency.
At EMA length 1, EMA equals close and BBP becomes high + low − 2 × close. For high 110, low 90 and close 90, the value is +20, not nearly zero. At close 110 it is −20. Shortening the length does not mathematically force a flat oscillator or a particular number of crossovers.
Separate a state, an event and a future-confirmed pivot
| Observation | Precise condition | What remains unproven |
|---|---|---|
| Positive state | Current BBP > 0 | Next-bar direction or a trade entry |
| Cross above zero | Current BBP > 0 and previous BBP <= 0 | Execution price or profitable follow-through |
| Rising negative reading | Previous −6, current −2 | A positive state; current value is still below zero |
| Potential bearish divergence | Later price high higher, matched BBP high lower | A future reversal; pivot matching and confirmation are separate |
A transition from −2 to 0 changes this script's color branch to green without a strict cross above zero. A later move from 0 to +1 is a cross above zero even though the preceding branch was already green. Count numeric events rather than color transitions.
A swing-high detector requiring five bars to the right identifies a candidate at bar 30 no earlier than bar 35. Drawing a marker back on bar 30 must not give a strategy information at bar 30. Price and oscillator pivots also need an explicit matching rule; independently detected peaks need not occur on the same bar.
Adding an RSI crossing means deciding whether both crossings must happen on the same completed bar or whether one may precede the other by a defined number of bars. A vague claim of confluence hides that choice. No reduction in false signals is established by merely combining indicators.
Build a testable request from the arithmetic
- Record symbol, session, chart type, timeframe, EMA length and enough initial history. Compare the EMA and both components on the same closed bars.
- Confirm the identity BBP = 2 × (HL2 − EMA), including the two opposite-close examples and the zero-sum examples above.
- For an illustrative crossover study, define a confirmed cross above zero, an optional close-above-SMA(200) condition, and the next eligible execution time. These are research choices, not an established best configuration.
- Specify an exit rule independently. A 1.5 × ATR distance with ATR 2 is 3 price units; an assumed entry 100 and stop reference 97 do not guarantee execution at 97. A fill at 95 loses 5 per unit before costs.
- Compare 8, 13 or 21 only on the same recorded dataset and event definition, then evaluate dates excluded from selection. A five-minute chart still supplies bars to the EMA; no hard minimum timeframe follows from this formula.
- Include fees, spread, slippage and trade count. Indicator sign or syntax success alone establishes no win rate or expected return.
Ask the Pine Script AI Coding Agent for explicit length inputs, optional component plots and a defined confirmed-bar alert. Account access and usage depend on the selected product. Review generated source, compile it and verify the arithmetic before interpreting alerts.
Specify a BBP adaptation