OPEN-SOURCE SCRIPT

Accumulation Distribution Wave [forexobroker]

910
Accumulation Distribution Wave [forexobroker] tracks the classic Accumulation/Distribution line and turns its slope into an accumulation-vs-distribution wave regime. It also watches for a regular price/A-D divergence that flags hidden exhaustion. The wave regime sets the bias and a reclaim-EMA cross times entries, optionally gated to bars that show a confirming divergence.

🔶 ALGORITHM

1. Money flow multiplier = ((close-low) - (high-close)) / range, in [-1, +1].
2. A/D line accumulates money-flow-multiplier * volume bar by bar.
3. Wave = A/D minus an EMA of A/D (A/D Wave EMA). Wave > Min Wave Slope = accumulation (+1), wave < -Min Wave Slope = distribution (-1).
4. Divergence: over the Divergence Lookback, price at a new high while A/D is not = bearish; price at a new low while A/D is not = bullish.
5. A reclaim EMA times the entry: a confirmed close-cross in the wave-regime direction triggers, optionally requiring a same-side divergence (Divergence-Only Mode).
6. Cooldown, bar-close confirmation and a position-lock finalise the signal so it never repaints intrabar.

🔶 SIGNAL LOGIC

- Buy: in-session AND wave regime = accumulation AND close crosses over the reclaim EMA AND (Divergence-Only off OR bullish divergence present) AND position not already long AND cooldown elapsed AND barstate.isconfirmed.
- Sell: in-session AND wave regime = distribution AND close crosses under the reclaim EMA AND (Divergence-Only off OR bearish divergence present) AND position not already short AND cooldown elapsed AND barstate.isconfirmed.
Only fires while the A/D wave regime is non-flat.

🔶 INPUTS

- A/D group: A/D Wave EMA; A/D minus this EMA defines the wave (default 21).
- A/D group: Divergence Lookback comparing price vs A/D extremes (default 20).
- A/D group: Min Wave Slope, an optional minimum absolute wave in A/D units (default 0.0).
- A/D group: ATR Length for the reference table (default 14).
- Signal Logic group: Entry Reclaim EMA whose close-cross times entries (default 9).
- Signal Logic group: Divergence-Only Mode and Cooldown Bars between signals (default 5).
- Filters group: optional session restriction with a configurable window (default off).
- Visual group: dashboard, 3-layer glow, reclaim-EMA plot and buy/sell colors (dashboard default on).

🔶 ALERTS

ADW Buy, ADW Sell, ADW Any Signal, ADW Accum On, ADW Distrib On, ADW Bull Div, ADW Bear Div, ADW EMA Up, ADW EMA Down, ADW Wave Zero, ADW Any Div, ADW Regime Flip, ADW Webhook JSON.

🔶 LIMITATIONS

- The A/D line is a running cumulative sum, so absolute values depend on chart history length and warm-up.
- Volume-based, so it requires a real volume feed; on forex it falls back to broker tick-volume, which is a proxy only.
- Money-flow-multiplier signing is an estimate of accumulation, not true bid/ask delta.
- Divergence detection uses lookback extremes and can lag at sharp turns.
- Defaults are tuned for liquid instruments; thin symbols may need a longer wave EMA.

Feragatname

Bilgiler ve yayınlar, TradingView tarafından sağlanan veya onaylanan finansal, yatırım, alım satım veya diğer türden tavsiye veya öneriler anlamına gelmez ve teşkil etmez. Kullanım Koşulları bölümünde daha fazlasını okuyun.