OPEN-SOURCE SCRIPT
Buy Sell Pressure Oscillator [forexobroker]

Buy Sell Pressure Oscillator [forexobroker] splits each bar's volume into estimated buy volume and estimated sell volume using where price closed within the bar's range, then smooths the net difference into a normalised -100..100 pressure oscillator. The oscillator's sign sets a pressure regime; a reclaim-EMA cross times entries, or the raw zero-line cross in Zero-Cross-Only mode. It turns raw volume into a directional read of who is in control.
🔶 ALGORITHM
1. Compute the close position in range: (close - low) / (high - low), defaulting to 0.5 on a zero-range bar.
2. Estimate buy volume = volume x close-position, and sell volume = volume x (1 - close-position).
3. Take the net buy-minus-sell volume and smooth it with an EMA over the Pressure Smoothing length.
4. Normalise the smoothed net by average volume over the Volume Norm Length and scale to a -100..100 oscillator.
5. The oscillator sign sets the pressure regime (positive = buy, negative = sell); |oscillator| above Strong Pressure flags a strong regime.
6. Inside the active regime, a close-cross of the Entry Reclaim EMA times the entry; in Zero-Cross-Only mode the oscillator's zero-line cross fires instead.
🔶 SIGNAL LOGIC
- Buy: in-session AND regime tradable AND (Zero-Cross-Only: oscillator crosses above zero; else buy regime AND close crosses over reclaim EMA) AND not already long AND cooldown elapsed AND barstate.isconfirmed (position-locked).
- Sell: in-session AND regime tradable AND (Zero-Cross-Only: oscillator crosses below zero; else sell regime AND close crosses under reclaim EMA) AND not already short AND cooldown elapsed AND barstate.isconfirmed (position-locked).
Only fires when the pressure regime is tradable (or strong, if Require Strong Pressure is on).
🔶 INPUTS
- Pressure: EMA smoothing applied to net buy-minus-sell volume; default Pressure Smoothing = 14.
- Pressure: average-volume length the pressure is normalised by; default Volume Norm Length = 20.
- Pressure: Strong Pressure threshold on the |oscillator|; default Strong Pressure = 25.0.
- Pressure: ATR length for context; default ATR Length = 14.
- Signal Logic: Entry Reclaim EMA that times the entry inside the regime; default Entry Reclaim EMA = 9.
- Signal Logic: Zero-Cross-Only mode and Require Strong Pressure toggles; both default off.
- Signal Logic: Cooldown bars between signals; default Cooldown Bars = 5.
- Filters / Visual: optional session window, dashboard, 3-layer glow, reclaim-EMA plot, and colors; dashboard default on.
🔶 ALERTS
BSP Buy, BSP Sell, BSP Any Signal, BSP Zero Up, BSP Zero Down, BSP Strong Buy, BSP Strong Sell, BSP EMA Up, BSP EMA Down, BSP Bull Regime, BSP Bear Regime, BSP Any Zero Cross, BSP Webhook JSON.
🔶 LIMITATIONS
- The buy/sell split is an estimate from close-in-range, not true order-flow tick data.
- Requires a real volume feed; symbols with no or synthetic volume produce a meaningless oscillator.
- Needs warm-up bars for the smoothing EMA and the volume normalisation window.
- Strong-pressure default is tuned for liquid instruments; thin markets may need a different threshold.
- The reclaim EMA adds deliberate entry lag versus the raw zero-cross, by design.
🔶 ALGORITHM
1. Compute the close position in range: (close - low) / (high - low), defaulting to 0.5 on a zero-range bar.
2. Estimate buy volume = volume x close-position, and sell volume = volume x (1 - close-position).
3. Take the net buy-minus-sell volume and smooth it with an EMA over the Pressure Smoothing length.
4. Normalise the smoothed net by average volume over the Volume Norm Length and scale to a -100..100 oscillator.
5. The oscillator sign sets the pressure regime (positive = buy, negative = sell); |oscillator| above Strong Pressure flags a strong regime.
6. Inside the active regime, a close-cross of the Entry Reclaim EMA times the entry; in Zero-Cross-Only mode the oscillator's zero-line cross fires instead.
🔶 SIGNAL LOGIC
- Buy: in-session AND regime tradable AND (Zero-Cross-Only: oscillator crosses above zero; else buy regime AND close crosses over reclaim EMA) AND not already long AND cooldown elapsed AND barstate.isconfirmed (position-locked).
- Sell: in-session AND regime tradable AND (Zero-Cross-Only: oscillator crosses below zero; else sell regime AND close crosses under reclaim EMA) AND not already short AND cooldown elapsed AND barstate.isconfirmed (position-locked).
Only fires when the pressure regime is tradable (or strong, if Require Strong Pressure is on).
🔶 INPUTS
- Pressure: EMA smoothing applied to net buy-minus-sell volume; default Pressure Smoothing = 14.
- Pressure: average-volume length the pressure is normalised by; default Volume Norm Length = 20.
- Pressure: Strong Pressure threshold on the |oscillator|; default Strong Pressure = 25.0.
- Pressure: ATR length for context; default ATR Length = 14.
- Signal Logic: Entry Reclaim EMA that times the entry inside the regime; default Entry Reclaim EMA = 9.
- Signal Logic: Zero-Cross-Only mode and Require Strong Pressure toggles; both default off.
- Signal Logic: Cooldown bars between signals; default Cooldown Bars = 5.
- Filters / Visual: optional session window, dashboard, 3-layer glow, reclaim-EMA plot, and colors; dashboard default on.
🔶 ALERTS
BSP Buy, BSP Sell, BSP Any Signal, BSP Zero Up, BSP Zero Down, BSP Strong Buy, BSP Strong Sell, BSP EMA Up, BSP EMA Down, BSP Bull Regime, BSP Bear Regime, BSP Any Zero Cross, BSP Webhook JSON.
🔶 LIMITATIONS
- The buy/sell split is an estimate from close-in-range, not true order-flow tick data.
- Requires a real volume feed; symbols with no or synthetic volume produce a meaningless oscillator.
- Needs warm-up bars for the smoothing EMA and the volume normalisation window.
- Strong-pressure default is tuned for liquid instruments; thin markets may need a different threshold.
- The reclaim EMA adds deliberate entry lag versus the raw zero-cross, by design.
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.
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
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.
🔵Gain access to our powerful tools : forexobroker.com/tv
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/dominicwalsfxhtrader
All scripts & content provided by Forexobroker are for informational & educational purposes only.
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.