OPEN-SOURCE SCRIPT
Aggiornato DCA Helper

Disciplines your DCA strategy by splitting your buy zone into N pre-calculated levels. Triggers buy signals only when price touches a level within the discount zone.
How it works:
The indicator automatically divides the discount zone (bottom 20% of a 50-bar range) into N equal parts. Each part is a potential DCA entry (L1, L2, ..., LN). Signals fire ONLY when price touches a specific level — never in "no man's land" between levels.
Entry filters (all must pass):
Price below both MA(50) AND MA(200) → double trend confirmation
RSI(14) below 35 → oversold filter
Price within bottom 20% of range (discount zone)
Price sustained in discount for 3 consecutive bars (anti-spike)
20-bar cooldown between signals
Within 0.5% of a level (no in-between triggers)
Chart visualization:
🟩 Light green box = discount zone (where levels operate)
🟦 Blue dashed box = full high/low range (context)
➕ White dotted line = 50% equilibrium level
🟧 Orange line = average DCA price
🔷 Green "DCA" diamond below bar = each executed level
🟢➖🟢 Horizontal green lines = the N levels, labeled L1 price (% vs current), L2 ..., etc.
Level color: more intense the deeper (better price)
Info table (top-right):
Now: current price
Avg: current average + # buys/N
Complete: average if ALL N levels fill (ideal position avg)
L1, L2, ..., LN: each level price + % vs current, colored by risk:
🟢 Green = close (entry ready)
🟠 Orange = medium
🔴 Red = far below (better discount but more waiting)
Configurable inputs:
DCA levels (1-10) — number of staggered buys
Trigger proximity to level (%) — max distance for level trigger
Filter MA length (fast/slow)
RSI buy level
Range lookback
Discount threshold
Sustained bars
Min bars between signals
How to use for real DCA:
1.
Check the "Complete" row in the table → that's your avg if you split position across N levels
2.
Decide total size (e.g., $10k) and divide into N parts
3.
Set alerts on "DCA" diamonds for each level
4.
Buy the corresponding part when each level triggers
How it works:
The indicator automatically divides the discount zone (bottom 20% of a 50-bar range) into N equal parts. Each part is a potential DCA entry (L1, L2, ..., LN). Signals fire ONLY when price touches a specific level — never in "no man's land" between levels.
Entry filters (all must pass):
Price below both MA(50) AND MA(200) → double trend confirmation
RSI(14) below 35 → oversold filter
Price within bottom 20% of range (discount zone)
Price sustained in discount for 3 consecutive bars (anti-spike)
20-bar cooldown between signals
Within 0.5% of a level (no in-between triggers)
Chart visualization:
🟩 Light green box = discount zone (where levels operate)
🟦 Blue dashed box = full high/low range (context)
➕ White dotted line = 50% equilibrium level
🟧 Orange line = average DCA price
🔷 Green "DCA" diamond below bar = each executed level
🟢➖🟢 Horizontal green lines = the N levels, labeled L1 price (% vs current), L2 ..., etc.
Level color: more intense the deeper (better price)
Info table (top-right):
Now: current price
Avg: current average + # buys/N
Complete: average if ALL N levels fill (ideal position avg)
L1, L2, ..., LN: each level price + % vs current, colored by risk:
🟢 Green = close (entry ready)
🟠 Orange = medium
🔴 Red = far below (better discount but more waiting)
Configurable inputs:
DCA levels (1-10) — number of staggered buys
Trigger proximity to level (%) — max distance for level trigger
Filter MA length (fast/slow)
RSI buy level
Range lookback
Discount threshold
Sustained bars
Min bars between signals
How to use for real DCA:
1.
Check the "Complete" row in the table → that's your avg if you split position across N levels
2.
Decide total size (e.g., $10k) and divide into N parts
3.
Set alerts on "DCA" diamonds for each level
4.
Buy the corresponding part when each level triggers
Note di rilascio
- Added strategy mode selector: Long / Long & Short / Short- Added separate Long and Short DCA levels (5 each by default, configurable 1-10)
- Each level fires only once per cycle (no more repeated buys at same level)
- Cycle auto-resets when price exits the discount/premium zone by a configurable threshold (default 60% of range)
- Added Short Avg, Long Avg, Net Pos and "Complete" avg prominently displayed in table and as chart lines
- Long and Short entry signals are independent: separate MA, RSI, sustained and proximity filters per side
- Inputs grouped: General, Trend, Momentum, Timing for easier tuning
- Level lines: solid (filled) vs dotted (pending) with check-mark on filled levels
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.
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.
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.