OPEN-SOURCE SCRIPT
Orderflow Imbalance Pressure [JOAT]

Orderflow Imbalance Pressure [JOAT]
Introduction
Orderflow Imbalance Pressure is an open-source indicator that estimates the imbalance between buying and selling pressure on each bar without access to real bid-ask data, derives a Z-score normalized delta oscillator from that estimate, tracks cumulative delta over the session, and detects structural divergences between price extremes and delta behavior at confirmed pivot points.
The core analytical insight is that when price reaches a new high while the cumulative buying pressure behind it is declining, the move is potentially unsupported — buyers are diminishing while the market is being pushed to new levels. Conversely, price making new lows while selling pressure contracts suggests exhaustion rather than conviction. These divergences are objectively measurable and provide leading context that price action alone does not.
Core Concepts
1. Delta Estimation from OHLC
True tick-level delta (bid volume minus ask volume) requires raw tick data. This indicator estimates it from bar data using the classic candle ratio method: buying pressure is proportional to how close the close is to the high, and selling pressure to how close it is to the low:
Pine Script®
This is an approximation — not a substitute for real order flow data — but provides a directionally useful signal on instruments where tick data is unavailable.
2. Delta Z-Score Normalization
Raw delta varies in scale across instruments and volume conditions. The indicator normalizes delta by computing a rolling Z-score: the delta minus its period mean, divided by its period standard deviation. This produces a dimensionless oscillator centered at zero:
Pine Script®
Extreme Z-score readings above +1.5 or below -1.5 indicate statistically significant delta imbalances relative to recent history.

3. Cumulative Delta
Delta values are accumulated across the session to track the net buying or selling bias since session open. The cumulative delta line is scaled and overlaid on the histogram for context. Session resets are configurable (None, Session, or Manual). The cumulative delta often reveals sustained institutional bias that individual bar delta obscures.
4. Imbalance Threshold Markers
When the delta ratio (delta divided by total volume) exceeds a configurable threshold (default 0.6 = 60% of volume in one direction), the bar is classified as an extreme imbalance. Triangle markers appear at these bars and the background is lightly tinted. Extreme imbalance bars often mark exhaustion points or momentum bursts.
5. Pivot-Confirmed Divergence Detection
Divergences are detected using confirmed structural pivots rather than rolling high/low lookbacks. A bullish divergence requires a confirmed pivot low that is lower than the prior confirmed pivot low, while the cumulative delta at that pivot is higher than at the prior one. This fires a signal only at genuine structural turning points — typically 5–10 signals per extended chart rather than hundreds:
Pine Script®
Features
Input Parameters
Delta Engine:
Cumulative Delta:
Signal Settings:
How to Use This Indicator
Step 1: Read the Delta Bias
Check the dashboard's Bias row. BUYING PRESSURE, SELLING PRESSURE, or BALANCED reflects the current delta ratio. Use this to understand whether the current bar's volume is dominated by buyers or sellers.
Step 2: Watch the Cumulative Delta Trend
A rising cumulative delta line during a price advance confirms the move is volume-supported. Declining cumulative delta during a price advance is a warning sign that buyers are weakening.
Step 3: Act on Divergence Signals
When a DIV label appears (bullish or bearish), a confirmed structural pivot has formed with a diverging cumulative delta. This is the primary signal output of the indicator — use it to anticipate potential turning points in price.
Step 4: Note Extreme Imbalance Bars
The triangle markers at extreme imbalance bars often coincide with momentum exhaustion (after a sustained run) or momentum ignition (at a breakout). Context determines which interpretation applies.
Indicator Limitations
Originality Statement
The combination of OHLC delta estimation, Z-score normalization, cumulative session delta with configurable resets, and pivot-confirmed divergence detection — requiring structural pivot confirmation rather than rolling lookback extremes — in a single publication is the original contribution. The pivot-gated divergence detection specifically prevents the signal spam common in delta divergence tools that use rolling high/low comparisons.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Delta estimation from OHLC data is an approximation. All signals are based on historical data and do not guarantee future results. Trading involves substantial risk of loss.
-Made with passion by jackofalltrades
Introduction
Orderflow Imbalance Pressure is an open-source indicator that estimates the imbalance between buying and selling pressure on each bar without access to real bid-ask data, derives a Z-score normalized delta oscillator from that estimate, tracks cumulative delta over the session, and detects structural divergences between price extremes and delta behavior at confirmed pivot points.
The core analytical insight is that when price reaches a new high while the cumulative buying pressure behind it is declining, the move is potentially unsupported — buyers are diminishing while the market is being pushed to new levels. Conversely, price making new lows while selling pressure contracts suggests exhaustion rather than conviction. These divergences are objectively measurable and provide leading context that price action alone does not.
Core Concepts
1. Delta Estimation from OHLC
True tick-level delta (bid volume minus ask volume) requires raw tick data. This indicator estimates it from bar data using the classic candle ratio method: buying pressure is proportional to how close the close is to the high, and selling pressure to how close it is to the low:
float buyVol = rng > 0.0 ? volume * (close - low) / rng : volume * 0.5
float sellVol = rng > 0.0 ? volume * (high - close) / rng : volume * 0.5
float delta = buyVol - sellVol
This is an approximation — not a substitute for real order flow data — but provides a directionally useful signal on instruments where tick data is unavailable.
2. Delta Z-Score Normalization
Raw delta varies in scale across instruments and volume conditions. The indicator normalizes delta by computing a rolling Z-score: the delta minus its period mean, divided by its period standard deviation. This produces a dimensionless oscillator centered at zero:
float deltaZ = deltaStd > 0.0 ? (delta - deltaMA) / deltaStd : 0.0
Extreme Z-score readings above +1.5 or below -1.5 indicate statistically significant delta imbalances relative to recent history.
3. Cumulative Delta
Delta values are accumulated across the session to track the net buying or selling bias since session open. The cumulative delta line is scaled and overlaid on the histogram for context. Session resets are configurable (None, Session, or Manual). The cumulative delta often reveals sustained institutional bias that individual bar delta obscures.
4. Imbalance Threshold Markers
When the delta ratio (delta divided by total volume) exceeds a configurable threshold (default 0.6 = 60% of volume in one direction), the bar is classified as an extreme imbalance. Triangle markers appear at these bars and the background is lightly tinted. Extreme imbalance bars often mark exhaustion points or momentum bursts.
5. Pivot-Confirmed Divergence Detection
Divergences are detected using confirmed structural pivots rather than rolling high/low lookbacks. A bullish divergence requires a confirmed pivot low that is lower than the prior confirmed pivot low, while the cumulative delta at that pivot is higher than at the prior one. This fires a signal only at genuine structural turning points — typically 5–10 signals per extended chart rather than hundreds:
if not na(pivotLow)
float dAtPivot = cumDelta[pivSide]
if pivotLow < lastPivLow and dAtPivot > lastPivLowDelta
bullDiv := true
Features
- OHLC-based delta estimation: Buy and sell volume proxy from candle structure
- Z-score normalized oscillator: Delta normalized by rolling mean and standard deviation
- Gradient histogram: Bars colored by delta direction and magnitude intensity
- Cumulative delta overlay: Net session delta as a scaled line on the oscillator
- Session reset modes: None, Session boundary, or Manual reset options
- Extreme imbalance markers: Triangle shapes at bars exceeding the delta ratio threshold
- Pivot-confirmed divergences: Bull and bear divergences fired only at structural pivot points
- Dashboard: Current delta, bias, buy volume, sell volume, cumulative delta, and Z-score
- Six alert conditions: Bull/bear imbalance, bull/bear divergence, delta surge bull/bear
Input Parameters
Delta Engine:
- Delta Smoothing EMA: Smoothing for delta oscillator line (default: 3)
- Delta Normalization Length: Z-score rolling window (default: 20)
- Imbalance Threshold: Delta ratio required for extreme marker (default: 0.6)
Cumulative Delta:
- Show Cumulative Delta toggle
- Reset Mode: None, Session, or Manual (default: Session)
- Cumulative EMA Smooth: Smoothing for cumulative line (default: 5)
Signal Settings:
- Delta Divergence Signal toggle
- Divergence Lookback: Base period for pivot divergence detection (default: 20)
How to Use This Indicator
Step 1: Read the Delta Bias
Check the dashboard's Bias row. BUYING PRESSURE, SELLING PRESSURE, or BALANCED reflects the current delta ratio. Use this to understand whether the current bar's volume is dominated by buyers or sellers.
Step 2: Watch the Cumulative Delta Trend
A rising cumulative delta line during a price advance confirms the move is volume-supported. Declining cumulative delta during a price advance is a warning sign that buyers are weakening.
Step 3: Act on Divergence Signals
When a DIV label appears (bullish or bearish), a confirmed structural pivot has formed with a diverging cumulative delta. This is the primary signal output of the indicator — use it to anticipate potential turning points in price.
Step 4: Note Extreme Imbalance Bars
The triangle markers at extreme imbalance bars often coincide with momentum exhaustion (after a sustained run) or momentum ignition (at a breakout). Context determines which interpretation applies.
Indicator Limitations
- OHLC delta estimation is a proxy; it does not capture true bid-ask imbalance and will systematically differ from actual order flow data
- On instruments with wide spreads or gaps, the candle ratio delta estimation becomes less reliable
- Divergences in strong trends often resolve with further trend continuation before the divergence is acted upon
- Cumulative delta resets at session boundaries, so intraday and multi-day comparisons require switching reset modes
Originality Statement
The combination of OHLC delta estimation, Z-score normalization, cumulative session delta with configurable resets, and pivot-confirmed divergence detection — requiring structural pivot confirmation rather than rolling lookback extremes — in a single publication is the original contribution. The pivot-gated divergence detection specifically prevents the signal spam common in delta divergence tools that use rolling high/low comparisons.
Disclaimer
This indicator is provided for educational and informational purposes only. It is not financial advice. Delta estimation from OHLC data is an approximation. All signals are based on historical data and do not guarantee future results. Trading involves substantial risk of loss.
-Made with passion by jackofalltrades
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
The AI Trading Ecosystem, Built to win trades 📈
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Get Full Access 👇
jackofalltrades.vip 🌐
t.me/jackofalltradesvip 🃏
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.