OPEN-SOURCE SCRIPT

Buy Sell Pressure Oscillator [forexobroker]

719
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.

כתב ויתור

המידע והפרסומים אינם מיועדים להיות, ואינם מהווים, ייעוץ או המלצה פיננסית, השקעתית, מסחרית או מכל סוג אחר המסופקת או מאושרת על ידי TradingView. קרא עוד ב־תנאי השימוש.