OPEN-SOURCE SCRIPT
Accumulation Distribution Wave [forexobroker]

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.
🔶 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.
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
🔵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.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。
开源脚本
秉承TradingView的精神,该脚本的作者将其开源,以便交易者可以查看和验证其功能。向作者致敬!您可以免费使用该脚本,但请记住,重新发布代码须遵守我们的网站规则。
🔵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.
免责声明
这些信息和出版物并非旨在提供,也不构成TradingView提供或认可的任何形式的财务、投资、交易或其他类型的建议或推荐。请阅读使用条款了解更多信息。