PROTECTED SOURCE SCRIPT

RPGexBOPDELTA (BOP + Delta BG + Div)

9
RPGexBOPDELTA (BOP + Delta BG + Div) — Description (EN)

RPGexBOPDELTA is a momentum/pressure oscillator built around Balance of Power (BOP) with an additional Delta-of-BOP confirmation engine, background regime coloring, and automatic price vs BOP divergence detection. It’s designed to help you quickly identify when control shifts between buyers and sellers, filter noise with confirmation bars, and spot early reversal signals through divergences.

What it plots

BOP Histogram (columns):
BOP is calculated as
(
𝐶
𝑙
𝑜
𝑠
𝑒

𝑂
𝑝
𝑒
𝑛
)
/
(
𝐻
𝑖
𝑔


𝐿
𝑜
𝑤
)
(Close−Open)/(High−Low).
Positive values indicate bullish pressure inside the candle range; negative values indicate bearish pressure.

Optional BOP Delta Line:
Displays the change in BOP from one bar to the next (BOP Delta), useful to visualize acceleration/deceleration.

Background & histogram color logic (Delta Confirmation)

The indicator colors the histogram and background based on the sign of BOP Delta:

Green: BOP Delta > 0 (pressure increasing)

Red: BOP Delta < 0 (pressure decreasing)

Gray: neutral / undefined

To reduce false flips, you can enable Delta Confirmation, requiring N consecutive bars (ConfirmBars) with the same BOP Delta sign before the color/background changes. This turns raw “flickers” into cleaner regime shifts.

BOP zero-cross turn markers (optional)

When enabled, the script marks BOP side changes (crossing above/below zero) with yellow triangle markers at the zero line:

Up triangle when BOP confirms a turn to positive

Down triangle when BOP confirms a turn to negative

You can also apply BOP Confirmation Bars to require multiple bars before validating the zero-cross change.

Divergence detection (Price vs BOP)

When enabled, the indicator detects classic divergences using pivot highs/lows:

Bearish divergence: Price makes a higher high, while BOP makes a lower high
(potential weakening bullish pressure)

Bullish divergence: Price makes a lower low, while BOP makes a higher low
(potential weakening bearish pressure)

Pivot sensitivity is controlled by PivotStrength, and divergence markers are plotted with a configurable vertical offset for clarity.

Alerts included

Color Flip Alert: triggers when the confirmed color regime flips green ↔ red

Bullish Divergence Alert

Bearish Divergence Alert

Inputs overview

Smoothing: optional SMA smoothing of BOP (Smooth, Use Smoothing)

Delta Confirmation: require consecutive bars before regime change (Use Delta Confirmation, ConfirmBars)

BOP Confirmation: confirm zero-cross turns (Use BOP Confirmation, BOPConfirmBars)

Divergences: pivot-based price vs BOP (Detect Divergence, PivotStrength, Price Source, Marker Offset)

Display: optional BOP Delta line (Show BOP Delta line)

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.