OPEN-SOURCE SCRIPT

Delta Barometer [JOAT]

7 247
Delta Barometer [JOAT]

Introduction

Delta Barometer is an open-source dual-engine institutional pressure indicator that generates directional signals from two independent momentum measurement systems — an ATR trailing stop with Trend Strength Score, and a cumulative delta volume crossover with Pressure Score — and allows the user to configure how the two engines interact via four hybrid modes.

The core insight is that trend-following signals and momentum signals often disagree during transition periods and agree during high-probability setups. By building both engines independently, assigning each a score that reflects the quality of its reading, and providing modes that require either one engine, either engine, or both engines simultaneously, the indicator lets traders choose the selectivity level appropriate to their strategy. Requiring confluence produces fewer but higher-quality signals; allowing either engine to fire produces more signals with less selectivity.

snapshot

Core Concepts

1. Engine A: ATR Trailing Stop with Trend Strength Score

A regime-adaptive ATR trailing stop is computed with different multipliers for low, medium, and high volatility environments. The ATR ratio determines the regime. The trail ratchets in one direction only and produces a signal on flip.

A Trend Strength Score (TSS) between 0 and 100 qualifies each trail flip: RSI slope magnitude contributes 40%, volume rate relative to its average contributes 35%, and ATR expansion relative to a shorter ATR period contributes 25%.

Pine Script®


2. Engine B: Cumulative Delta Volume with Pressure Score

Signed volume (positive when close is above open, negative otherwise) is accumulated into a running cumulative delta. A moving average of the cumulative delta is computed. A crossover of delta above its moving average is a potential bullish signal; a crossunder is bearish.

A Pressure Score between 0 and 100 qualifies each delta crossover: the magnitude of the delta ratio contributes 40%, volume rate relative to average contributes 35%, and candle body size relative to candle range contributes 25%.

3. Four Hybrid Modes

Both Engines: A signal requires both Engine A and Engine B to produce a raw signal simultaneously. Highest selectivity.
Priority A: Engine A signals take precedence; Engine B fills gaps where A is not firing.
Priority B: Engine B signals take precedence; Engine A fills gaps where B is not firing.
Either Engine: A signal fires when either engine produces a raw signal. Highest frequency.

4. Regime Arming

Each engine can be restricted to fire only in compatible volatility regimes — preventing the trailing engine from generating whipsaw signals during volatility compression.

5. Five-State Pressure Candle Coloring

Bar colors reflect the combined pressure state across both engines on a five-level scale: strong bull, moderate bull, neutral, moderate bear, strong bear.

snapshot

Features

  • Engine A — ATR trail with TSS: Regime-adaptive trailing stop with Trend Strength Score qualifying each flip signal
  • Engine B — Delta volume with Pressure Score: Cumulative signed volume crossover with composite Pressure Score qualification
  • Four hybrid modes: Both Engines, Priority A, Priority B, Either Engine — configurable selectivity
  • Regime arming: Each engine independently armed for specific volatility regimes
  • Five-state pressure candle coloring: Strong bull / moderate bull / neutral / moderate bear / strong bear reflected in bar colors
  • Gradient trail fill: Gradient between trailing stop and close; color inverts with trail direction
  • Trade block on signal: Entry, stop (correctly positioned above entry for shorts, below for longs), and TP level rendered as colored boxes on confirmed signals. Stop line is bold dashed red with high-contrast label background. Entry always sits visually between the stop and take-profit zones
  • 9-column horizontal dashboard: Mode, regime, TSS, pressure score, trail direction, delta, engine ID, signal state, status — shown in a horizontal table layout at chart bottom
  • Non-repainting: All signals confirmed on barstate.isconfirmed
  • Four color themes: Phantom, Neon, Classic, Solar
  • Backtest tracker: Win rate and expected value tracked per engine type


Input Parameters

Engine A — ATR Trail:
  • ATR Length, Low/Med/High Regime Multipliers
  • Regime ATR Lookback, Low/High Vol Thresholds
  • TSS Lookback and Min TSS Score to fire


Engine B — Delta Volume:
  • Delta MA Length, Min Pressure Score
  • RSI Overbought/Oversold gates


Hybrid Mode:
  • Hybrid Mode: Both Engines / Priority A / Priority B / Either Engine
  • Engine A and B arming: All / Low Only / Med + High / High Only


Signal:
  • Cooldown Bars, TP ATR Multiple, SL % from Entry


How to Use This Indicator

Step 1: Select the Hybrid Mode
Start with Either Engine for maximum signal frequency. Switch to Both Engines when you want only the highest-conviction setups. Priority modes are useful when you trust one engine more than the other for a particular asset.

Step 2: Read the 9-Column Dashboard
The horizontal dashboard shows the current state of both engines simultaneously. The ENGINE column shows which engine fired (A, B, or A+B for confluence). The TSS and PRESSURE columns show the raw quality scores of each engine.

Step 3: Verify Trade Block Direction
For LONG signals: the red risk box appears below entry (stop is below) and the green reward box appears above entry (TP is above). For SHORT signals: the red risk box appears above entry (stop is above) and the green reward box appears below entry (TP is below). Entry is always the dividing line between the two zones.

Step 4: Use Regime Arming for Market Fit
If the asset tends to trend strongly, arm Engine A for all regimes. If it is more volatile-momentum driven, arm Engine B for all regimes. Use Med + High arming for Engine A to avoid choppy low-volatility whipsaws.

Indicator Limitations

  • The TSS score components all lag price by varying amounts. Signals in fast-moving markets may arrive after the optimal entry point
  • Cumulative delta volume as used here is a proxy. It approximates institutional bias without access to true bid-ask tick data
  • Both Engines mode will produce very few signals on most assets. Adjust to Priority or Either modes if signal frequency is too low
  • Regime classification uses ATR ratio, which is a lagging measure. A volatility spike that changes the regime will affect engine arming only after ATR responds


Originality Statement

  • The dual-engine architecture with four configurable interaction modes — each engine carrying its own qualification score — and per-engine regime arming is an original design not replicated in existing open-source Pine Script v6 publications
  • The Trend Strength Score weighting RSI slope, volume rate, and ATR expansion as qualification for ATR trail flip signals, combined with a separate Pressure Score for delta crossovers, provides independent signal quality assessment that single-engine indicators do not offer


Disclaimer

This indicator is provided for educational and informational purposes only. It is not financial advice. Trading involves substantial risk of loss. Past signal statistics do not predict future performance. The author accepts no responsibility for trading losses resulting from use of this indicator.

Made with passion by jackofalltrades

Aviso legal

As informações e publicações não se destinam a ser, e não constituem, conselhos ou recomendações financeiras, de investimento, comerciais ou de outro tipo fornecidos ou endossados pela TradingView. Leia mais nos Termos de Uso.