OPEN-SOURCE SCRIPT
RSI Oversold AO - Long Indicator

RSI Oversold AO DCA — Long Indicator
🔷 What it does:
This is a signal-only indicator that mirrors a dual-RSI-gated long DCA workflow. It tracks one virtual long position at a time, opened only on a lower-timeframe RSI cross-down into oversold, and averages the position with up to four safety orders on an aggressive 2× × 2× ladder — but each safety order requires the RSI to still be below 25 at the moment of fill. No falling-knife averaging into recovering momentum. Exit is a fixed Take Profit at 3% above average entry. Every event emits a webhook-ready JSON payload for a DCA Bot.
- Dual RSI gating: cross-down 30 entry trigger AND static less-than-25 continuation filter on every safety order.
- Aggressive 2× × 2× safety-order ladder: deviations 1.00%, 3.00%, 7.00%, 15.00%; sizes 60, 120, 240, 480 USDT.
- Fixed Take Profit: 3% above running average entry, no trailing.
- Honest virtual bookkeeping: total cost and qty updated incrementally on every fill — avg entry and open PnL displayed live.
- Six discrete events per cycle (entry + 4 AO fills + TP), each with its own webhook payload.
🔷 Who is it for:
- Swing traders running a DCA Bot on crypto pairs that frequently overshoot into oversold readings.
- Bot operators who want a chart-driven signal source that emits per-event JSON ready for a DCA Bot.
- Traders who want averaging gated by momentum continuation, not just price levels — the "no falling knives" guard prevents loading further when momentum has already reversed.
- Traders who want to monitor an evolving DCA position — base entry, owned AO levels, deployed capital, open PnL, live RSI readings — directly on the chart without the strategy-tester overhead.
🔷 How does it work:
Entry RSI Filter (Oversold Cross Down): A 15-minute RSI(7) is sampled via request.security with lookahead disabled. The entry gate fires when RSI crosses down through 30 — momentum has just entered oversold territory. At host-bar close, if the indicator is flat and the cross is fresh, the virtual long position opens.
Safety Order Ladder (Dual Gate): After entry, the indicator monitors two conditions in parallel for each pending safety order: price deviation downward against the position AND a static RSI continuation filter. The k-th safety order fires only when close ≤ base entry × (1 − cumulative deviation) AND the 15-minute RSI(7) is still below 25. Cumulative deviation grows by the step multiplier (default 2×): 1.00%, 3.00%, 7.00%, 15.00%. Each safety order's virtual size grows by 2×: 60, 120, 240, 480 USDT.
Why the AO Gate Matters: A pure price-ladder DCA blindly averages into any decline. The RSI < 25 gate stops the averaging if momentum has reversed back above 25 — the asset is no longer oversold by the indicator's definition, and adding to the position would mean buying a recovery, not a dip. This filter trades off some averaging frequency for materially higher average-entry quality.
Honest Virtual Bookkeeping: Total cost and qty are updated incrementally on every fill, so the avg entry, deployed capital, and open PnL displayed in the status table reflect the actual broker-equivalent position state — no shortcut from base entry, no synthetic averaging.
Exit: A fixed Take Profit at 3% above the running average entry. When close hits the TP target, the close webhook fires and the virtual position resets.
🔷 Why it's unique:
- Dual RSI Gating: Most DCA indicators gate only the entry. This indicator gates both the entry (cross-down momentum trigger) and the continuation of averaging (static oversold filter on every safety order).
- Aggressive 2× × 2× Ladder: Most published DCA tools use mild 1.05–1.25× compounding. This one doubles both the deviation step and the size each rung — the position scales fast if all safety orders fill, but only inside a confirmed oversold regime.
- Fill-by-Fill Avg Entry: The orange avg-entry line is derived from running totals updated on every event — what you see is what the broker-equivalent position would actually have.
- Per-Event Webhook Ledger: Six distinct events per cycle, each with its own JSON alert payload. The indicator drives a DCA Bot end-to-end through a single TradingView alert.
🔷 Considerations Before Using the Indicator:
Market & Timeframe: Designed for liquid crypto pairs on 1h–2h ranges. Default thresholds are calibrated for DOGEUSDT 1h. Different pairs may need RSI threshold and deviation ladder tuning.
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.
Aggressive Compounding: The 2× × 2× ladder is more aggressive than typical published DCAs. If all four safety orders fill, the position scales from 100 USDT base to 1,000 USDT total. Match the indicator's per-slot 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 beyond the 4-AO ladder. Risk is structurally capped on the bot side by the bounded position-size ladder. If a hard exchange-side stop is required, configure it on the bot directly.
RSI Oversold Continuation: The AO gate uses a static RSI < 25 check, not a cross. If RSI dips to 20 and stays there for multiple bars while price drops further, all four AOs can fill in succession. Conversely, a sharp RSI recovery above 25 freezes the ladder mid-position.
Backtesting Note: This is an indicator, not a strategy. There is no built-in P&L tester. For performance metrics over a 4-month sample (~44 closed trades, 77.27% win rate, 0.96% max drawdown, profit factor 5.791, +1.26% net return), use the companion strategy version on identical parameters. The 44-trade sample is below the typical ≥100 floor for statistical confidence — re-run on a 12+ month window for a more robust validation.
🔷 How to Use It:
🔸 Add the indicator to a 1h chart on the crypto pair you want to trade.
🔸 Review the entry RSI filter (timeframe / length / level), the AO gate RSI filter, the 4-AO ladder parameters, and the Take Profit percentage. Defaults are calibrated for DOGEUSDT 1h — recalibrate per asset before deploying.
🔸 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_DOGE).
🔸 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.
Averaging Orders per Trade: Maximum number of safety orders per cycle (default 4).
First AO Size (USDT): Virtual size of the first safety order; subsequent AOs scale by the Size Multiplier.
Deviation to First AO (%): Distance from base entry at which AO1 becomes eligible.
Deviation Step Multiplier: Ladder factor that widens each subsequent deviation step.
Order Size Multiplier: Factor that grows each subsequent safety order's USDT size.
Entry RSI Timeframe / Length / Level: Lower-timeframe RSI cross-down filter for the base entry.
AO Trigger RSI Timeframe / Length / Less Than: Lower-timeframe RSI continuation filter for each safety order.
Take Profit (%): Fixed distance above the running average entry where the virtual long closes.
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle AO Ladder, 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 dual-RSI-gated long DCA workflow. It tracks one virtual long position at a time, opened only on a lower-timeframe RSI cross-down into oversold, and averages the position with up to four safety orders on an aggressive 2× × 2× ladder — but each safety order requires the RSI to still be below 25 at the moment of fill. No falling-knife averaging into recovering momentum. Exit is a fixed Take Profit at 3% above average entry. Every event emits a webhook-ready JSON payload for a DCA Bot.
- Dual RSI gating: cross-down 30 entry trigger AND static less-than-25 continuation filter on every safety order.
- Aggressive 2× × 2× safety-order ladder: deviations 1.00%, 3.00%, 7.00%, 15.00%; sizes 60, 120, 240, 480 USDT.
- Fixed Take Profit: 3% above running average entry, no trailing.
- Honest virtual bookkeeping: total cost and qty updated incrementally on every fill — avg entry and open PnL displayed live.
- Six discrete events per cycle (entry + 4 AO fills + TP), each with its own webhook payload.
🔷 Who is it for:
- Swing traders running a DCA Bot on crypto pairs that frequently overshoot into oversold readings.
- Bot operators who want a chart-driven signal source that emits per-event JSON ready for a DCA Bot.
- Traders who want averaging gated by momentum continuation, not just price levels — the "no falling knives" guard prevents loading further when momentum has already reversed.
- Traders who want to monitor an evolving DCA position — base entry, owned AO levels, deployed capital, open PnL, live RSI readings — directly on the chart without the strategy-tester overhead.
🔷 How does it work:
Entry RSI Filter (Oversold Cross Down): A 15-minute RSI(7) is sampled via request.security with lookahead disabled. The entry gate fires when RSI crosses down through 30 — momentum has just entered oversold territory. At host-bar close, if the indicator is flat and the cross is fresh, the virtual long position opens.
Safety Order Ladder (Dual Gate): After entry, the indicator monitors two conditions in parallel for each pending safety order: price deviation downward against the position AND a static RSI continuation filter. The k-th safety order fires only when close ≤ base entry × (1 − cumulative deviation) AND the 15-minute RSI(7) is still below 25. Cumulative deviation grows by the step multiplier (default 2×): 1.00%, 3.00%, 7.00%, 15.00%. Each safety order's virtual size grows by 2×: 60, 120, 240, 480 USDT.
Why the AO Gate Matters: A pure price-ladder DCA blindly averages into any decline. The RSI < 25 gate stops the averaging if momentum has reversed back above 25 — the asset is no longer oversold by the indicator's definition, and adding to the position would mean buying a recovery, not a dip. This filter trades off some averaging frequency for materially higher average-entry quality.
Honest Virtual Bookkeeping: Total cost and qty are updated incrementally on every fill, so the avg entry, deployed capital, and open PnL displayed in the status table reflect the actual broker-equivalent position state — no shortcut from base entry, no synthetic averaging.
Exit: A fixed Take Profit at 3% above the running average entry. When close hits the TP target, the close webhook fires and the virtual position resets.
🔷 Why it's unique:
- Dual RSI Gating: Most DCA indicators gate only the entry. This indicator gates both the entry (cross-down momentum trigger) and the continuation of averaging (static oversold filter on every safety order).
- Aggressive 2× × 2× Ladder: Most published DCA tools use mild 1.05–1.25× compounding. This one doubles both the deviation step and the size each rung — the position scales fast if all safety orders fill, but only inside a confirmed oversold regime.
- Fill-by-Fill Avg Entry: The orange avg-entry line is derived from running totals updated on every event — what you see is what the broker-equivalent position would actually have.
- Per-Event Webhook Ledger: Six distinct events per cycle, each with its own JSON alert payload. The indicator drives a DCA Bot end-to-end through a single TradingView alert.
🔷 Considerations Before Using the Indicator:
Market & Timeframe: Designed for liquid crypto pairs on 1h–2h ranges. Default thresholds are calibrated for DOGEUSDT 1h. Different pairs may need RSI threshold and deviation ladder tuning.
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.
Aggressive Compounding: The 2× × 2× ladder is more aggressive than typical published DCAs. If all four safety orders fill, the position scales from 100 USDT base to 1,000 USDT total. Match the indicator's per-slot 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 beyond the 4-AO ladder. Risk is structurally capped on the bot side by the bounded position-size ladder. If a hard exchange-side stop is required, configure it on the bot directly.
RSI Oversold Continuation: The AO gate uses a static RSI < 25 check, not a cross. If RSI dips to 20 and stays there for multiple bars while price drops further, all four AOs can fill in succession. Conversely, a sharp RSI recovery above 25 freezes the ladder mid-position.
Backtesting Note: This is an indicator, not a strategy. There is no built-in P&L tester. For performance metrics over a 4-month sample (~44 closed trades, 77.27% win rate, 0.96% max drawdown, profit factor 5.791, +1.26% net return), use the companion strategy version on identical parameters. The 44-trade sample is below the typical ≥100 floor for statistical confidence — re-run on a 12+ month window for a more robust validation.
🔷 How to Use It:
🔸 Add the indicator to a 1h chart on the crypto pair you want to trade.
🔸 Review the entry RSI filter (timeframe / length / level), the AO gate RSI filter, the 4-AO ladder parameters, and the Take Profit percentage. Defaults are calibrated for DOGEUSDT 1h — recalibrate per asset before deploying.
🔸 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_DOGE).
🔸 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.
Averaging Orders per Trade: Maximum number of safety orders per cycle (default 4).
First AO Size (USDT): Virtual size of the first safety order; subsequent AOs scale by the Size Multiplier.
Deviation to First AO (%): Distance from base entry at which AO1 becomes eligible.
Deviation Step Multiplier: Ladder factor that widens each subsequent deviation step.
Order Size Multiplier: Factor that grows each subsequent safety order's USDT size.
Entry RSI Timeframe / Length / Level: Lower-timeframe RSI cross-down filter for the base entry.
AO Trigger RSI Timeframe / Length / Less Than: Lower-timeframe RSI continuation filter for each safety order.
Take Profit (%): Fixed distance above the running average entry where the virtual long closes.
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle AO Ladder, 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.
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.
📈 Stop guessing your settings — backtest & optimize with QuantPilot
🎁 Free to start
🎁 Free to start
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.
📈 Stop guessing your settings — backtest & optimize with QuantPilot
🎁 Free to start
🎁 Free to start
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.