OPEN-SOURCE SCRIPT
BSP Divergence Stats

Every candle tells two stories: what the price did, and what the volume pressure did. Most of the time they agree. When they disagree, that's the signal.
The indicator splits each candle into sub-candles (1m + 2m by default) and calculates two metrics per sub-candle:
Buying Pressure (BP) — how much of the move was driven by buyers, measured either as price distance (close - min(low, prev_close)) or as volume-weighted buy flow (volume × (close-low) / (high-low)).
Selling Pressure (SP) — the mirror: how much selling force was present this candle.
Both are smoothed with HMA(2) — fast enough to react intrabar, smooth enough to filter noise.
The 4 signals
🟣 Bull Divergence — price closed higher than previous bar, but BP fell. The upward move happened without buying support. This is a weak candle — buyers are exhausting. Historically tends to precede a pullback.
🟠 Bear Divergence — price closed lower, but SP fell. The selloff lost its fuel. Sellers are giving up. Historically tends to precede a bounce.
👁 Hidden Buy — candle is red (price fell) but the DV ratio shows buyers actually dominated the volume. Smart money was accumulating into the drop. Price direction was misleading.
👁 Hidden Sell — candle is green but sellers dominated volume. Distribution into strength. The move up was absorbed by smart selling.
How to read the table
The table has two sections that update every tick:
Current Candle shows what is happening right now inside the forming bar — the live buy/sell direction, the ratio of buying vs selling volume, whether BP and SP momentum are rising or falling, and which signal (if any) is active.
Next Candle Bias is a weighted score of all 6 factors converted to a probability. A reading of 72% UP means the current conditions have historically preceded an up candle 72% of the time in the last N bars. The score bar shows the raw strength, and the driver line tells you which factor is dominating the prediction.
The historical edge lines at the bottom (Bull Div hist: ↑38% ↓62%) are the most honest part of the indicator — they show the actual back-tested outcome for the exact signal currently active on this instrument and timeframe.
How to use it
Step 1 — Check the signal color. A purple or orange candle means pressure diverged from price. A faint green or red means hidden flow. No color means no signal — trade normally.
Step 2 — Check the table. Look at the Current Candle section. Is BP rising or falling? Is there a Hidden signal active? These tell you the quality of the current move.
Step 3 — Check Next Candle Bias. Only act on signals where the bias is above 60% and the historical edge confirms it. A 72% UP bias with H.Buy hist: ↑68% ↓32% is a meaningful edge. A 55% UP with LOW confidence is noise.
Step 4 — Read the label. Every colored candle gets a label showing the signal type and its historical next-bar statistics. This is your quick reference without opening the table.
Settings guide
SettingRecommendationSub TF 1 / TF 2Should be smaller than your chart TF. On 5m chart: 1m + 2m. On 15m: 3m + 5m. On 1H: 10m + 15mLookback100 bars is a good default. Lower = more responsive to recent regime. Higher = more statistically stablePressure ModeDelta Volume is more reliable on liquid instruments with real volume data. Pressure mode works on any instrumentLabel SizeUse tiny on busy charts, small or normal when you want to read the stats clearly
What it is not
This is a pressure and flow indicator, not a trend indicator. It does not tell you where price is going in the big picture — only whether the current candle's internal mechanics are consistent with its direction. Use it alongside a trend filter or support/resistance levels for best results. A Hidden Buy signal in a strong downtrend is a scalp opportunity, not a reversal trade.
The indicator splits each candle into sub-candles (1m + 2m by default) and calculates two metrics per sub-candle:
Buying Pressure (BP) — how much of the move was driven by buyers, measured either as price distance (close - min(low, prev_close)) or as volume-weighted buy flow (volume × (close-low) / (high-low)).
Selling Pressure (SP) — the mirror: how much selling force was present this candle.
Both are smoothed with HMA(2) — fast enough to react intrabar, smooth enough to filter noise.
The 4 signals
🟣 Bull Divergence — price closed higher than previous bar, but BP fell. The upward move happened without buying support. This is a weak candle — buyers are exhausting. Historically tends to precede a pullback.
🟠 Bear Divergence — price closed lower, but SP fell. The selloff lost its fuel. Sellers are giving up. Historically tends to precede a bounce.
👁 Hidden Buy — candle is red (price fell) but the DV ratio shows buyers actually dominated the volume. Smart money was accumulating into the drop. Price direction was misleading.
👁 Hidden Sell — candle is green but sellers dominated volume. Distribution into strength. The move up was absorbed by smart selling.
How to read the table
The table has two sections that update every tick:
Current Candle shows what is happening right now inside the forming bar — the live buy/sell direction, the ratio of buying vs selling volume, whether BP and SP momentum are rising or falling, and which signal (if any) is active.
Next Candle Bias is a weighted score of all 6 factors converted to a probability. A reading of 72% UP means the current conditions have historically preceded an up candle 72% of the time in the last N bars. The score bar shows the raw strength, and the driver line tells you which factor is dominating the prediction.
The historical edge lines at the bottom (Bull Div hist: ↑38% ↓62%) are the most honest part of the indicator — they show the actual back-tested outcome for the exact signal currently active on this instrument and timeframe.
How to use it
Step 1 — Check the signal color. A purple or orange candle means pressure diverged from price. A faint green or red means hidden flow. No color means no signal — trade normally.
Step 2 — Check the table. Look at the Current Candle section. Is BP rising or falling? Is there a Hidden signal active? These tell you the quality of the current move.
Step 3 — Check Next Candle Bias. Only act on signals where the bias is above 60% and the historical edge confirms it. A 72% UP bias with H.Buy hist: ↑68% ↓32% is a meaningful edge. A 55% UP with LOW confidence is noise.
Step 4 — Read the label. Every colored candle gets a label showing the signal type and its historical next-bar statistics. This is your quick reference without opening the table.
Settings guide
SettingRecommendationSub TF 1 / TF 2Should be smaller than your chart TF. On 5m chart: 1m + 2m. On 15m: 3m + 5m. On 1H: 10m + 15mLookback100 bars is a good default. Lower = more responsive to recent regime. Higher = more statistically stablePressure ModeDelta Volume is more reliable on liquid instruments with real volume data. Pressure mode works on any instrumentLabel SizeUse tiny on busy charts, small or normal when you want to read the stats clearly
What it is not
This is a pressure and flow indicator, not a trend indicator. It does not tell you where price is going in the big picture — only whether the current candle's internal mechanics are consistent with its direction. Use it alongside a trend filter or support/resistance levels for best results. A Hidden Buy signal in a strong downtrend is a scalp opportunity, not a reversal trade.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.
Skrip open-source
Dengan semangat TradingView yang sesungguhnya, pembuat skrip ini telah menjadikannya sebagai sumber terbuka, sehingga para trader dapat meninjau dan memverifikasi fungsinya. Salut untuk penulisnya! Meskipun Anda dapat menggunakannya secara gratis, perlu diingat bahwa penerbitan ulang kode ini tunduk pada Tata Tertib kami.
Pernyataan Penyangkalan
Informasi dan publikasi ini tidak dimaksudkan, dan bukan merupakan, saran atau rekomendasi keuangan, investasi, trading, atau jenis lainnya yang diberikan atau didukung oleh TradingView. Baca selengkapnya di Ketentuan Penggunaan.