OPEN-SOURCE SCRIPT
LTC RSI Oversold Doubling DCA - Long Indicator

LTC RSI Oversold Doubling DCA - Long Indicator
🔷 What it does:
This is a signal-only indicator that mirrors a high-conviction LTC dip-buying workflow with an aggressive doubling-martingale safety ladder. It tracks one virtual long position at a time, opened only when LTC prints a deep oversold reading on 4-hour RSI AND trades below a configurable price ceiling. Four safety orders fire at fixed deviations from base entry (−2.5%, −5%, −10%, −20%) with sizes doubling on every rung. Exit is a wide 35% Take Profit from average entry. The indicator computes running average entry, deployed capital, open PnL, and lifetime realized PnL — all derived from honest fill-by-fill bookkeeping. Every event emits a webhook-ready JSON alert payload for direct DCA Bot consumption.
- Extremely selective dual-filter entry: 4h RSI < 29 AND close below price ceiling (default $61).
- Non-uniform fixed-deviation safety ladder: −2.5%, −5%, −10%, −20% from base entry.
- Doubling safety-order sizes: 2k / 4k / 8k / 16k USDT.
- Wide 35% Take Profit — built for deep-oversold recoveries, not scalp profit.
- Honest virtual bookkeeping: Open PnL and lifetime Total PnL displayed live on the chart.
🔷 Who is it for:
- Patient swing traders running a DCA Bot on LTC who want to ride deep oversold reversals.
- Bot operators who want a chart-driven signal source that emits per-event JSON ready for a DCA Bot.
- Traders who can absorb a doubling martingale up to 31% of equity deployed per trade in exchange for a wide 35% profit target.
- Operators tracking long-cycle position management — entry, four staged safety fills, and a single exit — directly on the chart without the strategy-tester overhead.
🔷 How does it work:
Entry Filter (Dual Gate): A 4-hour RSI(14) is sampled via request.security with lookahead disabled. The entry gate requires TWO conditions simultaneously at host-bar close: RSI must be below 29 (deep oversold) AND the close price must be below the configurable ceiling (default $61). Both gates filter out shallow dips and price moves above the strategy's "value zone".
Base Entry: When both gates align, the indicator marks a virtual long entry, captures the base entry price, and seeds the cost-basis ledger with the configured base order size (default 1,000 USDT).
Safety Order Ladder (Fixed Deviations, Doubling Sizes): After base fill, the indicator monitors price deviation against the position. Each safety order has its own fixed deviation from base entry — not a cumulative ladder. AO1 fills at close ≤ base × 0.975 (−2.5%); AO2 at −5%; AO3 at −10%; AO4 at −20%. USDT sizes double from a 2,000 first AO: 2,000 / 4,000 / 8,000 / 16,000. Each fill updates the running cost-basis and dispatches its own webhook payload.
Honest Virtual Bookkeeping: Total cost and qty are updated incrementally on every event, so the avg entry, deployed capital, Open PnL, and Total PnL displayed in the status table reflect the actual broker-equivalent position state — no shortcut from base entry, no synthetic averaging.
Lifetime Total PnL: When the position closes for profit, the realized PnL from that cycle accumulates into a lifetime counter. The status table displays both Open PnL (current cycle, resets on exit) and Total PnL (lifetime, persists across the chart history) — giving traders a real-time read on cumulative performance without a backtest engine.
Exit: A fixed 35% Take Profit above the running average entry. When close hits the TP target, the close webhook fires, realized PnL accumulates, and the virtual position resets.
🔷 Why it's unique:
- Extremely Selective Entry: Most DCA indicators fire frequently. This one is gated by two independent filters (deep RSI oversold + price ceiling) that almost never align — the companion strategy's backtest produced 11 closed trades across 4 years of LTC history.
- Non-Uniform Fixed-Deviation Ladder: Most published DCA tools use formula-based ladders (step × multiplier). This one exposes each AO deviation as a direct input, allowing asymmetric ladders like 2.5% / 5% / 10% / 20% — deeper safety orders trigger only on serious adverse moves.
- Doubling Martingale: 1 / 2 / 4 / 8 / 16 size progression scales position capital exponentially if the position runs adverse, but only inside the defined price ceiling.
- Lifetime PnL Tracking: Open PnL and Total PnL are displayed live on the chart — Open resets per cycle, Total persists across the entire chart history. The indicator gives strategy-tester-equivalent insight without running a backtest.
- Per-Event Webhook Ledger: Six discrete events per cycle (entry + 4 AO fills + TP), each with its own JSON alert payload. One TradingView alert with "Any alert() function call" drives a DCA Bot end-to-end.
🔷 Considerations Before Using the Indicator:
Selectivity & Sample Size: The companion strategy fires roughly 2–3 times per year on LTC. This is an extremely low-frequency setup by design — the entry filter is built to fire only on deep oversold prints inside the configured price ceiling. The 4-year backtest produced 11 trades with a 100% win rate and profit factor of 1,661 — these metrics reflect the entry filter's discipline, not a deterministic edge. Treat them as an indication that the setup is high-quality, not a forward-performance guarantee.
Aggressive Capital Deployment: If all four safety orders fill, total deployed capital reaches 31,000 USDT = 31% of the default reference equity. The doubling martingale amplifies both upside on recovery and risk if the lower bound breaks. Match the indicator's per-AO allocation to your bot's grid configuration to keep the avg-entry display honest.
No Stop Loss: There is no exit signal on adverse moves below AO4 (−20% from base). If price keeps falling, the virtual position holds unhedged until either price recovers to the 35% TP target or the user intervenes. Risk is structurally capped on the bot side by the bounded position ladder; if a hard exchange-side stop is required, configure it on the bot directly.
Price Ceiling Configuration: The default $61 ceiling was set against LTC's historical accumulation range. Update this input if LTC enters a new structural price regime — the indicator will not fire above the ceiling regardless of RSI readings.
Wide Profit Target: The 35% Take Profit is large by DCA standards. Position holding times can stretch into months or longer as the indicator waits for the recovery.
Cross Detection Granularity: Entries and AO fills are evaluated on bar close. A bar that spikes through a level and returns within the same bar may be missed by design — this matches realistic polling behavior and avoids over-signaling on intra-bar wicks.
Live vs Historical State: The virtual position state is rebuilt from chart history each time the indicator is recompiled. If the indicator is added mid-deployment or the live bot diverges from the signal stream (manual interventions, partial fills), the indicator state may not match the live bot. Toggle the indicator off and on to reset.
Backtesting Note: This is an indicator, not a strategy. There is no built-in P&L tester — but the live Total PnL counter in the status table gives a running approximation. For full metrics over a 4-year sample (~11 closed trades, 100% win rate, 6.50% max drawdown, profit factor 1,661, +13.91% net return), use the companion strategy version on identical parameters.
🔷 How to Use It:
🔸 Add the indicator to a LTC / USD or LTC / USDT chart on 4h.
🔸 Review the entry filters (RSI level + price ceiling), the four AO deviations and sizes, and the Take Profit percentage. Defaults are calibrated for LTC 4h — recalibrate the price ceiling whenever LTC's structural range shifts.
🔸 Set Base Order Size and AO sizes to match your bot's grid configuration (the indicator's avg-entry display becomes meaningful when virtual sizing matches real sizing).
🔸 In the DCA Bot Webhook group, paste the Bot ID, Email Token, and Pair (QUOTE_BASE format, e.g., USDT_LTC).
🔸 Create an alert on the indicator with "Any alert() function call". Paste the DCA Bot's webhook URL into the alert's Webhook field. The indicator will emit JSON payloads for entry, each safety order, and TP exit — formatted for direct DCA Bot consumption.
🔷 INDICATOR SETTINGS
Base Order Size (USDT): Virtual order size for the avg-entry / open-PnL computation.
AO1 / AO2 / AO3 / AO4 Deviation (%): Fixed distance from base entry where each safety order becomes eligible. Non-uniform by design.
AO1 / AO2 / AO3 / AO4 Size (USDT): Virtual USDT amount of each safety order. Doubles at each rung by default.
RSI Timeframe / Length / Less Than: Lower-timeframe RSI filter for the base entry.
Price Below ($): Absolute price ceiling — entry only fires below this level.
Take Profit (%): Fixed distance above the running average entry where the virtual long closes.
Active Window: Optional date filter — when ON, the indicator only fires signals between From and To dates.
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle AO Ladder, Price Ceiling line, Avg / TP plot lines, fill labels, signal triangles, status table.
Brand Watermark: Configurable text, position, size, and transparency.
👨🏻💻💭 We hope this tool helps enhance your trading. Your feedback is invaluable, so feel free to share any suggestions for improvements or new features you'd like to see implemented.
__
The information and publications within the 3Commas TradingView account are not meant to be and do not constitute financial, investment, trading, or other types of advice or recommendations supplied or endorsed by 3Commas and any of the parties acting on behalf of 3Commas, including its employees, contractors, ambassadors, etc.
🔷 What it does:
This is a signal-only indicator that mirrors a high-conviction LTC dip-buying workflow with an aggressive doubling-martingale safety ladder. It tracks one virtual long position at a time, opened only when LTC prints a deep oversold reading on 4-hour RSI AND trades below a configurable price ceiling. Four safety orders fire at fixed deviations from base entry (−2.5%, −5%, −10%, −20%) with sizes doubling on every rung. Exit is a wide 35% Take Profit from average entry. The indicator computes running average entry, deployed capital, open PnL, and lifetime realized PnL — all derived from honest fill-by-fill bookkeeping. Every event emits a webhook-ready JSON alert payload for direct DCA Bot consumption.
- Extremely selective dual-filter entry: 4h RSI < 29 AND close below price ceiling (default $61).
- Non-uniform fixed-deviation safety ladder: −2.5%, −5%, −10%, −20% from base entry.
- Doubling safety-order sizes: 2k / 4k / 8k / 16k USDT.
- Wide 35% Take Profit — built for deep-oversold recoveries, not scalp profit.
- Honest virtual bookkeeping: Open PnL and lifetime Total PnL displayed live on the chart.
🔷 Who is it for:
- Patient swing traders running a DCA Bot on LTC who want to ride deep oversold reversals.
- Bot operators who want a chart-driven signal source that emits per-event JSON ready for a DCA Bot.
- Traders who can absorb a doubling martingale up to 31% of equity deployed per trade in exchange for a wide 35% profit target.
- Operators tracking long-cycle position management — entry, four staged safety fills, and a single exit — directly on the chart without the strategy-tester overhead.
🔷 How does it work:
Entry Filter (Dual Gate): A 4-hour RSI(14) is sampled via request.security with lookahead disabled. The entry gate requires TWO conditions simultaneously at host-bar close: RSI must be below 29 (deep oversold) AND the close price must be below the configurable ceiling (default $61). Both gates filter out shallow dips and price moves above the strategy's "value zone".
Base Entry: When both gates align, the indicator marks a virtual long entry, captures the base entry price, and seeds the cost-basis ledger with the configured base order size (default 1,000 USDT).
Safety Order Ladder (Fixed Deviations, Doubling Sizes): After base fill, the indicator monitors price deviation against the position. Each safety order has its own fixed deviation from base entry — not a cumulative ladder. AO1 fills at close ≤ base × 0.975 (−2.5%); AO2 at −5%; AO3 at −10%; AO4 at −20%. USDT sizes double from a 2,000 first AO: 2,000 / 4,000 / 8,000 / 16,000. Each fill updates the running cost-basis and dispatches its own webhook payload.
Honest Virtual Bookkeeping: Total cost and qty are updated incrementally on every event, so the avg entry, deployed capital, Open PnL, and Total PnL displayed in the status table reflect the actual broker-equivalent position state — no shortcut from base entry, no synthetic averaging.
Lifetime Total PnL: When the position closes for profit, the realized PnL from that cycle accumulates into a lifetime counter. The status table displays both Open PnL (current cycle, resets on exit) and Total PnL (lifetime, persists across the chart history) — giving traders a real-time read on cumulative performance without a backtest engine.
Exit: A fixed 35% Take Profit above the running average entry. When close hits the TP target, the close webhook fires, realized PnL accumulates, and the virtual position resets.
🔷 Why it's unique:
- Extremely Selective Entry: Most DCA indicators fire frequently. This one is gated by two independent filters (deep RSI oversold + price ceiling) that almost never align — the companion strategy's backtest produced 11 closed trades across 4 years of LTC history.
- Non-Uniform Fixed-Deviation Ladder: Most published DCA tools use formula-based ladders (step × multiplier). This one exposes each AO deviation as a direct input, allowing asymmetric ladders like 2.5% / 5% / 10% / 20% — deeper safety orders trigger only on serious adverse moves.
- Doubling Martingale: 1 / 2 / 4 / 8 / 16 size progression scales position capital exponentially if the position runs adverse, but only inside the defined price ceiling.
- Lifetime PnL Tracking: Open PnL and Total PnL are displayed live on the chart — Open resets per cycle, Total persists across the entire chart history. The indicator gives strategy-tester-equivalent insight without running a backtest.
- Per-Event Webhook Ledger: Six discrete events per cycle (entry + 4 AO fills + TP), each with its own JSON alert payload. One TradingView alert with "Any alert() function call" drives a DCA Bot end-to-end.
🔷 Considerations Before Using the Indicator:
Selectivity & Sample Size: The companion strategy fires roughly 2–3 times per year on LTC. This is an extremely low-frequency setup by design — the entry filter is built to fire only on deep oversold prints inside the configured price ceiling. The 4-year backtest produced 11 trades with a 100% win rate and profit factor of 1,661 — these metrics reflect the entry filter's discipline, not a deterministic edge. Treat them as an indication that the setup is high-quality, not a forward-performance guarantee.
Aggressive Capital Deployment: If all four safety orders fill, total deployed capital reaches 31,000 USDT = 31% of the default reference equity. The doubling martingale amplifies both upside on recovery and risk if the lower bound breaks. Match the indicator's per-AO allocation to your bot's grid configuration to keep the avg-entry display honest.
No Stop Loss: There is no exit signal on adverse moves below AO4 (−20% from base). If price keeps falling, the virtual position holds unhedged until either price recovers to the 35% TP target or the user intervenes. Risk is structurally capped on the bot side by the bounded position ladder; if a hard exchange-side stop is required, configure it on the bot directly.
Price Ceiling Configuration: The default $61 ceiling was set against LTC's historical accumulation range. Update this input if LTC enters a new structural price regime — the indicator will not fire above the ceiling regardless of RSI readings.
Wide Profit Target: The 35% Take Profit is large by DCA standards. Position holding times can stretch into months or longer as the indicator waits for the recovery.
Cross Detection Granularity: Entries and AO fills are evaluated on bar close. A bar that spikes through a level and returns within the same bar may be missed by design — this matches realistic polling behavior and avoids over-signaling on intra-bar wicks.
Live vs Historical State: The virtual position state is rebuilt from chart history each time the indicator is recompiled. If the indicator is added mid-deployment or the live bot diverges from the signal stream (manual interventions, partial fills), the indicator state may not match the live bot. Toggle the indicator off and on to reset.
Backtesting Note: This is an indicator, not a strategy. There is no built-in P&L tester — but the live Total PnL counter in the status table gives a running approximation. For full metrics over a 4-year sample (~11 closed trades, 100% win rate, 6.50% max drawdown, profit factor 1,661, +13.91% net return), use the companion strategy version on identical parameters.
🔷 How to Use It:
🔸 Add the indicator to a LTC / USD or LTC / USDT chart on 4h.
🔸 Review the entry filters (RSI level + price ceiling), the four AO deviations and sizes, and the Take Profit percentage. Defaults are calibrated for LTC 4h — recalibrate the price ceiling whenever LTC's structural range shifts.
🔸 Set Base Order Size and AO sizes to match your bot's grid configuration (the indicator's avg-entry display becomes meaningful when virtual sizing matches real sizing).
🔸 In the DCA Bot Webhook group, paste the Bot ID, Email Token, and Pair (QUOTE_BASE format, e.g., USDT_LTC).
🔸 Create an alert on the indicator with "Any alert() function call". Paste the DCA Bot's webhook URL into the alert's Webhook field. The indicator will emit JSON payloads for entry, each safety order, and TP exit — formatted for direct DCA Bot consumption.
🔷 INDICATOR SETTINGS
Base Order Size (USDT): Virtual order size for the avg-entry / open-PnL computation.
AO1 / AO2 / AO3 / AO4 Deviation (%): Fixed distance from base entry where each safety order becomes eligible. Non-uniform by design.
AO1 / AO2 / AO3 / AO4 Size (USDT): Virtual USDT amount of each safety order. Doubles at each rung by default.
RSI Timeframe / Length / Less Than: Lower-timeframe RSI filter for the base entry.
Price Below ($): Absolute price ceiling — entry only fires below this level.
Take Profit (%): Fixed distance above the running average entry where the virtual long closes.
Active Window: Optional date filter — when ON, the indicator only fires signals between From and To dates.
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle AO Ladder, Price Ceiling line, Avg / TP plot lines, fill labels, signal triangles, status table.
Brand Watermark: Configurable text, position, size, and transparency.
👨🏻💻💭 We hope this tool helps enhance your trading. Your feedback is invaluable, so feel free to share any suggestions for improvements or new features you'd like to see implemented.
__
The information and publications within the 3Commas TradingView account are not meant to be and do not constitute financial, investment, trading, or other types of advice or recommendations supplied or endorsed by 3Commas and any of the parties acting on behalf of 3Commas, including its employees, contractors, ambassadors, etc.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
📈 Stop guessing your settings — backtest & optimize with QuantPilot
🎁 Free to start
🎁 Free to start
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.
Skrip sumber terbuka
Dalam semangat TradingView sebenar, pencipta skrip ini telah menjadikannya sumber terbuka, jadi pedagang boleh menilai dan mengesahkan kefungsiannya. Terima kasih kepada penulis! Walaupuan anda boleh menggunakan secara percuma, ingat bahawa penerbitan semula kod ini tertakluk kepada Peraturan Dalaman.
📈 Stop guessing your settings — backtest & optimize with QuantPilot
🎁 Free to start
🎁 Free to start
Penafian
Maklumat dan penerbitan adalah tidak bertujuan, dan tidak membentuk, nasihat atau cadangan kewangan, pelaburan, dagangan atau jenis lain yang diberikan atau disahkan oleh TradingView. Baca lebih dalam Terma Penggunaan.