OPEN-SOURCE SCRIPT
Volume Spike Accumulation [forexobroker]

Volume Spike Accumulation [forexobroker] reads volume spikes through where the bar closed in its own range. A spike that closes in the upper part of the range is demand absorbing supply (accumulation); a spike closing in the lower part is supply (distribution). Accumulation arms a long bias and distribution a short bias, and entries time off an EMA reclaim in the bias direction so signals are frequent rather than one-per-spike.
🔶 ALGORITHM
1. Compute ATR and an SMA of volume over the volume-MA length as the baseline.
2. Flag a volume spike when volume >= k x its moving average.
3. Close-position classification: clsPos = (close - low) / (high - low). A spike with clsPos >= the close-position threshold is accumulation; clsPos <= 1 - threshold is distribution.
4. Relative volume = volume / volume-MA for the dashboard.
5. Accumulation arms a persistent long bias and distribution a persistent short bias, holding until the opposite classified spike fires.
6. Entry timing: an EMA reclaim (close crossing the entry-reclaim EMA in the bias direction), or strictly the classified spike bar in Spike-Only Mode.
🔶 SIGNAL LOGIC
- Buy: bias == long (last classified spike was accumulation) AND close crosses over the reclaim EMA (or an accumulation spike bar in Spike-Only Mode), in session, with no active long, cooldown elapsed, and barstate.isconfirmed; position locks long.
- Sell: bias == short (last classified spike was distribution) AND close crosses under the reclaim EMA (or a distribution spike bar in Spike-Only Mode), in session, with no active short, cooldown elapsed, and barstate.isconfirmed; position locks short.
Only fires while the persistent spike bias agrees with the entry direction.
🔶 INPUTS
- Volume group: volume MA length for the spike baseline (default 20).
- Volume group: spike multiple of the volume MA (default 1.8).
- Volume group: close-position threshold for accumulation vs distribution (default 0.66).
- Volume group: ATR length (default 14).
- Signal Logic group: entry reclaim EMA length (default 9).
- Signal Logic group: Spike-Only Mode toggle (default off) and cooldown bars (default 5).
- Filters group: restrict-to-session toggle and session window (default 0000-2400).
- Visual group: show dashboard, 3-layer glow, and reclaim EMA (all default on).
- Visual group: buy color, sell color, and dashboard background.
🔶 ALERTS
VSA Buy, VSA Sell, VSA Any Signal, VSA Accumulation, VSA Distribution, VSA Volume Spike, VSA Classified, VSA EMA Up, VSA EMA Down, VSA Bias Bull, VSA Bias Bear, VSA Spike Tick, VSA Webhook JSON.
🔶 LIMITATIONS
- Volume-based: needs a real volume feed; forex volume is tick-volume, which only approximates traded size.
- Needs warm-up bars for the volume MA and ATR before spikes are valid.
- The spike multiple default is tuned for liquid instruments; quiet or thin symbols may need it retuned.
- The persistent bias holds until an opposite classified spike fires, so it can stay stale through quiet periods.
- Signals confirm on bar close; close-position and bias can change intrabar before the bar finishes.
🔶 ALGORITHM
1. Compute ATR and an SMA of volume over the volume-MA length as the baseline.
2. Flag a volume spike when volume >= k x its moving average.
3. Close-position classification: clsPos = (close - low) / (high - low). A spike with clsPos >= the close-position threshold is accumulation; clsPos <= 1 - threshold is distribution.
4. Relative volume = volume / volume-MA for the dashboard.
5. Accumulation arms a persistent long bias and distribution a persistent short bias, holding until the opposite classified spike fires.
6. Entry timing: an EMA reclaim (close crossing the entry-reclaim EMA in the bias direction), or strictly the classified spike bar in Spike-Only Mode.
🔶 SIGNAL LOGIC
- Buy: bias == long (last classified spike was accumulation) AND close crosses over the reclaim EMA (or an accumulation spike bar in Spike-Only Mode), in session, with no active long, cooldown elapsed, and barstate.isconfirmed; position locks long.
- Sell: bias == short (last classified spike was distribution) AND close crosses under the reclaim EMA (or a distribution spike bar in Spike-Only Mode), in session, with no active short, cooldown elapsed, and barstate.isconfirmed; position locks short.
Only fires while the persistent spike bias agrees with the entry direction.
🔶 INPUTS
- Volume group: volume MA length for the spike baseline (default 20).
- Volume group: spike multiple of the volume MA (default 1.8).
- Volume group: close-position threshold for accumulation vs distribution (default 0.66).
- Volume group: ATR length (default 14).
- Signal Logic group: entry reclaim EMA length (default 9).
- Signal Logic group: Spike-Only Mode toggle (default off) and cooldown bars (default 5).
- Filters group: restrict-to-session toggle and session window (default 0000-2400).
- Visual group: show dashboard, 3-layer glow, and reclaim EMA (all default on).
- Visual group: buy color, sell color, and dashboard background.
🔶 ALERTS
VSA Buy, VSA Sell, VSA Any Signal, VSA Accumulation, VSA Distribution, VSA Volume Spike, VSA Classified, VSA EMA Up, VSA EMA Down, VSA Bias Bull, VSA Bias Bear, VSA Spike Tick, VSA Webhook JSON.
🔶 LIMITATIONS
- Volume-based: needs a real volume feed; forex volume is tick-volume, which only approximates traded size.
- Needs warm-up bars for the volume MA and ATR before spikes are valid.
- The spike multiple default is tuned for liquid instruments; quiet or thin symbols may need it retuned.
- The persistent bias holds until an opposite classified spike fires, so it can stay stale through quiet periods.
- Signals confirm on bar close; close-position and bias can change intrabar before the bar finishes.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
🔵Gain access to our powerful tools : kestutisbalciunas.com/tradingview/
🔵Join our free telegram for updates : t.me/algotradingedge
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/algotradingedge
All scripts & content provided by Forexobroker are for informational & educational purposes only.
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.
Script de código aberto
Em verdadeiro espírito do TradingView, o criador deste script o tornou de código aberto, para que os traders possam revisar e verificar sua funcionalidade. Parabéns ao autor! Embora você possa usá-lo gratuitamente, lembre-se de que a republicação do código está sujeita às nossas Regras da Casa.
🔵Gain access to our powerful tools : kestutisbalciunas.com/tradingview/
🔵Join our free telegram for updates : t.me/algotradingedge
All scripts & content provided by Forexobroker are for informational & educational purposes only.
🔵Join our free telegram for updates : t.me/algotradingedge
All scripts & content provided by Forexobroker are for informational & educational purposes only.
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.