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.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
🔵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.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.
오픈 소스 스크립트
트레이딩뷰의 진정한 정신에 따라, 이 스크립트의 작성자는 이를 오픈소스로 공개하여 트레이더들이 기능을 검토하고 검증할 수 있도록 했습니다. 작성자에게 찬사를 보냅니다! 이 코드는 무료로 사용할 수 있지만, 코드를 재게시하는 경우 하우스 룰이 적용된다는 점을 기억하세요.
🔵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.
면책사항
해당 정보와 게시물은 금융, 투자, 트레이딩 또는 기타 유형의 조언이나 권장 사항으로 간주되지 않으며, 트레이딩뷰에서 제공하거나 보증하는 것이 아닙니다. 자세한 내용은 이용 약관을 참조하세요.