OPEN-SOURCE SCRIPT
Cập nhật 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
Phát hành các Ghi chú
- 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
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.
Mã nguồn mở
Theo đúng tinh thần TradingView, tác giả của tập lệnh này đã công bố nó dưới dạng mã nguồn mở, để các nhà giao dịch có thể xem xét và xác minh chức năng. Chúc mừng tác giả! Mặc dù bạn có thể sử dụng miễn phí, hãy nhớ rằng việc công bố lại mã phải tuân theo Nội quy.
Thông báo miễn trừ trách nhiệm
Thông tin và các ấn phẩm này không nhằm mục đích, và không cấu thành, lời khuyên hoặc khuyến nghị về tài chính, đầu tư, giao dịch hay các loại khác do TradingView cung cấp hoặc xác nhận. Đọc thêm tại Điều khoản Sử dụng.