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 open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
🔵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.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.
Script open-source
Nello spirito di TradingView, l'autore di questo script lo ha reso open source, in modo che i trader possano esaminarne e verificarne la funzionalità. Complimenti all'autore! Sebbene sia possibile utilizzarlo gratuitamente, ricordiamo che la ripubblicazione del codice è soggetta al nostro Regolamento.
🔵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.
Declinazione di responsabilità
Le informazioni e le pubblicazioni non sono intese come, e non costituiscono, consulenza o raccomandazioni finanziarie, di investimento, di trading o di altro tipo fornite o approvate da TradingView. Per ulteriori informazioni, consultare i Termini di utilizzo.