OPEN-SOURCE SCRIPT

Enhanced Order Flow Pressure Gauge

561
Short Description:
Estimates bullish/bearish pressure by analyzing each candle’s close position within its range, then weighting that by volume. Detects potential trend shifts and provides real-time signals.

Full Description:
1. Purpose
The Enhanced Order Flow Pressure Gauge (OFPG+) is designed to approximate buy vs. sell pressure within each bar, even if you don’t have full Level II / order flow data. By measuring the candle’s close relative to its high-low range and multiplying by volume, OFPG+ provides insights into which side of the market (bulls or bears) is more aggressive in a given interval.

istantanea


2. Key Components

Pressure Score (Histogram):
Raw measure of each bar’s close position (rangePos) minus midpoint, multiplied by volume. If the bar closes near its high with decent volume, the score is positive (bullish). Conversely, a close near its low yields a negative (bearish) reading.

istantanea

Cumulative Pressure:
Sum of all pressure readings over time (similar to cumulative delta), reflecting the overall market bias.
Pressure Delta:
The change in cumulative pressure from one bar to the next, plotted as a line. Rising values suggest increasing bullish momentum, while falling values show growing bearish influence.

3. Visual Cues & Signals

Histogram (Pressure Profile): A color-coded bar for each candle, indicating net bullish (blue) or bearish (gray) intrabar pressure.
Pressure Delta Line: Plotted over the histogram. Turns bullish (blue) when net buy pressure is increasing, or bearish (gray) when net selling accelerates.

Background Highlights:
Turns lightly blue if the smoothed pressure line exceeds the positive threshold, or lightly gray if it goes below the negative threshold.
Bullish / Bearish Signals:
Bullish Signal occurs when the smoothed pressure line crosses above the positive threshold, combined with a positive Delta.
Bearish Signal occurs when the smoothed pressure line crosses below the negative threshold, combined with a negative Delta.

istantanea

Confirmed Signals:
After a bullish/bearish signal, OFPG+ checks the highest or lowest smoothed pressure values over a user-defined number of bars (signalLookback) to confirm momentum.
Plotshapes (diamond icons) appear on the chart to mark these confirmed reversals.

istantanea

4. Usage Scenarios

Trend-Following / Momentum: Watch for transitions from negative to positive net pressure or vice versa. Helps identify potential turning points.
Reversal Confirmation: The threshold-based signals plus the “confirmed” checks can help filter choppy conditions.
Volume-Weighted Insights: By factoring in volume, strong closes near the highs or lows are weighted more heavily, capturing sentiment shifts.

istantanea

5. Inputs & Parameters

Smoothing Length (length): The EMA period for smoothing the raw pressure score.
Volume Weight (volWeight): Scales the volume impact on pressure calculations.
Pressure Threshold (threshold): Defines when pressure is considered significantly bullish or bearish.
Signal Lookback (signalLookback): Number of bars to confirm momentum after a signal.

6. Alerts
Bullish Signal & Confirmed Bullish
Bearish Signal & Confirmed Bearish
These alerts can notify you in real-time about potential shifts in the market’s buying or selling pressure.

7. Disclaimer
This script provides an approximation of order flow by analyzing candle structure and volume. It does not represent actual exchange-level order data.
Past performance is not necessarily indicative of future results. Always conduct thorough analysis and use proper risk management.
Not financial advice. Use at your own discretion.

Declinazione di responsabilità

Le informazioni ed i contenuti pubblicati non costituiscono in alcun modo una sollecitazione ad investire o ad operare nei mercati finanziari. Non sono inoltre fornite o supportate da TradingView. Maggiori dettagli nelle Condizioni d'uso.