OPEN-SOURCE SCRIPT
Dual RSI DCA - Long Indicator

Dual RSI DCA — Long Indicator
🔷 What it does:
This is a signal-only indicator that mirrors a dollar-cost averaging long workflow with a dual RSI confirmation system. It identifies oversold reversal entries on the host chart using a lower-timeframe RSI cross-up, tracks a virtual position with up to five averaging fills on a deviation ladder, and fires the exit when the lower-timeframe RSI crosses down from overbought — but only after a minimum profit threshold from the running average entry has been reached.
- Base entry signal arms on a lower-timeframe RSI(14) crossing up the oversold level (default 31 on 3m).
- Up to five safety orders fire automatically as price ladders down, on a 1.3% step / 1.3 step multiplier / 1.25 size multiplier progression.
- Take profit fires only when the lower-timeframe RSI crosses down the overbought level (default 69) AND minimum profit (default 2.4%) from average entry has been reached.
- Every event emits a webhook-ready JSON alert payload formatted for direct DCA Bot consumption.
🔷 Who is it for:
- Swing traders running a DCA Bot on crypto pairs that frequently mean-revert from local extremes.
- Traders who want a clean oversold-to-overbought signal flow without the strategy-tester overhead.
- Bot operators looking for a chart-driven signal source that ships webhook JSON natively, with no glue scripts required.
- Anyone who wants to monitor a virtual DCA position with full transparency on average entry, fills, and deployed capital — directly on the chart.
🔷 How does it work:
Lower-Timeframe RSI Cross-Up: The indicator polls a lower-timeframe RSI through request.security and checks for a cross above the oversold level at each host-bar close. When the cross fires AND the indicator is flat, the base-entry event triggers, the virtual position state is initialized, and the entry webhook payload is dispatched.
Virtual Position Tracking: Once entered, the indicator captures the entry price, base USDT size, and seeds running totals of cost and asset units. Each subsequent safety order updates those totals so the average entry, total deployed capital, and profit zone are always derived from honest fill-by-fill bookkeeping.
Safety Order Ladder: Five deviation thresholds are pre-computed from the base entry (1.30%, 2.99%, 5.18%, 8.04%, 11.75% at default settings). When the close price reaches the next threshold, the corresponding safety-order signal fires, the virtual position updates, and the AO webhook payload is emitted. No RSI gating on the ladder — it's pure price action.
Take Profit Logic: Once price reaches the minimum-profit threshold above the running average entry, the exit becomes armed. The close signal then fires only when the lower-timeframe RSI crosses down from the overbought level — the indicator does not exit just because profit is reached, it waits for momentum confirmation.
🔷 Why it's unique:
- Dual-RSI Architecture: Two independent lower-timeframe RSI cross conditions — one gates the entry, one gates the exit. Most DCA tools use a filter on only one end of the deal; this one filters both.
- Profit-Armed Exit: The take profit does not fire on a static target. It waits for RSI to roll over from overbought, allowing winners to run while still requiring minimum profit before any close is considered.
- Honest Virtual Tracking: Average entry, total cost, deployed capital, and minimum-profit target are all computed from the same fill-by-fill bookkeeping a real broker would do. No price-from-base shortcuts.
- Webhook-First Design: Every event (base, each safety order, exit) emits a fully-formed JSON alert payload. Connect one alert to a DCA Bot's webhook URL and the indicator drives the bot end-to-end.
🔷 Considerations Before Using the Indicator:
Market & Timeframe: Designed for 3min crypto pairs with active mean-reversion behavior. Default RSI levels (31/69) are calibrated for liquid volatility; thin or strongly trending pairs may need recalibration.
Cross Detection Granularity: LTF RSI cross detection happens at host-bar close. A cross that completes and reverses inside a single host bar may be missed by design — this prevents over-signaling on intra-bar noise.
No Stop Loss: There is no exit signal on adverse moves beyond the safety-order ladder. Risk is structurally capped by the bounded position-size sequence — at default settings, base + all five safety orders deploy roughly 9.93% of equity, keeping the trade within the conventional 5–10% risk band. If a hard stop is required, layer it on the bot side.
Live vs Historical State: The virtual position state is rebuilt from the chart history each time the indicator is recompiled. If the indicator is added mid-trade 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. For performance metrics, use the companion strategy version on the same parameters.
🔷 How to Use It:
🔸 Add the indicator to a 3min crypto chart on the pair you want to trade.
🔸 Configure the order sizing inputs to match the DCA Bot's settings (base order size, first AO size, multipliers).
🔸 Set the entry RSI level (default 31) and exit RSI level (default 69) — these are the two RSI gates.
🔸 Set the minimum profit threshold (default 2.4%) — exits will not fire below this.
🔸 In the DCA Bot Webhook group, paste the Bot ID, Email Token, and Pair (QUOTE_BASE format, e.g., USDT_HYPE).
🔸 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 fully-formed JSON payloads for each event — no integration layer required.
🔷 INDICATOR SETTINGS
Base Order Size (USDT): USDT size of the initial entry. Used for the virtual avg-entry computation.
First AO Size (USDT): USDT size of the first safety order. Subsequent safety orders scale by the Size Multiplier.
Order Size Multiplier: Factor that grows each subsequent safety order's USDT size (default 1.25).
Averaging Orders per Trade: Maximum number of safety orders allowed per cycle (default 5).
Deviation to First AO (%): Distance from base entry where the first safety order becomes eligible (default 1.3%).
Deviation Step Multiplier: Ladder factor that widens each subsequent deviation step (default 1.3).
Entry RSI Timeframe / Length / Level: Lower-timeframe RSI configuration for the oversold cross-up entry (default 3m / 14 / 31).
Exit RSI Timeframe / Length / Level: Lower-timeframe RSI configuration for the overbought cross-down exit (default 3m / 14 / 69).
Minimum Profit (%): Threshold above the running average entry that must be reached before the exit signal can fire (default 2.4%).
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle the DCA Ladder, Signal Labels, Signal Triangles, Avg-Entry / Min-TP plots, and Status Table.
Brand Watermark: Configurable text, position (9 options), 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 dollar-cost averaging long workflow with a dual RSI confirmation system. It identifies oversold reversal entries on the host chart using a lower-timeframe RSI cross-up, tracks a virtual position with up to five averaging fills on a deviation ladder, and fires the exit when the lower-timeframe RSI crosses down from overbought — but only after a minimum profit threshold from the running average entry has been reached.
- Base entry signal arms on a lower-timeframe RSI(14) crossing up the oversold level (default 31 on 3m).
- Up to five safety orders fire automatically as price ladders down, on a 1.3% step / 1.3 step multiplier / 1.25 size multiplier progression.
- Take profit fires only when the lower-timeframe RSI crosses down the overbought level (default 69) AND minimum profit (default 2.4%) from average entry has been reached.
- Every event emits a webhook-ready JSON alert payload formatted for direct DCA Bot consumption.
🔷 Who is it for:
- Swing traders running a DCA Bot on crypto pairs that frequently mean-revert from local extremes.
- Traders who want a clean oversold-to-overbought signal flow without the strategy-tester overhead.
- Bot operators looking for a chart-driven signal source that ships webhook JSON natively, with no glue scripts required.
- Anyone who wants to monitor a virtual DCA position with full transparency on average entry, fills, and deployed capital — directly on the chart.
🔷 How does it work:
Lower-Timeframe RSI Cross-Up: The indicator polls a lower-timeframe RSI through request.security and checks for a cross above the oversold level at each host-bar close. When the cross fires AND the indicator is flat, the base-entry event triggers, the virtual position state is initialized, and the entry webhook payload is dispatched.
Virtual Position Tracking: Once entered, the indicator captures the entry price, base USDT size, and seeds running totals of cost and asset units. Each subsequent safety order updates those totals so the average entry, total deployed capital, and profit zone are always derived from honest fill-by-fill bookkeeping.
Safety Order Ladder: Five deviation thresholds are pre-computed from the base entry (1.30%, 2.99%, 5.18%, 8.04%, 11.75% at default settings). When the close price reaches the next threshold, the corresponding safety-order signal fires, the virtual position updates, and the AO webhook payload is emitted. No RSI gating on the ladder — it's pure price action.
Take Profit Logic: Once price reaches the minimum-profit threshold above the running average entry, the exit becomes armed. The close signal then fires only when the lower-timeframe RSI crosses down from the overbought level — the indicator does not exit just because profit is reached, it waits for momentum confirmation.
🔷 Why it's unique:
- Dual-RSI Architecture: Two independent lower-timeframe RSI cross conditions — one gates the entry, one gates the exit. Most DCA tools use a filter on only one end of the deal; this one filters both.
- Profit-Armed Exit: The take profit does not fire on a static target. It waits for RSI to roll over from overbought, allowing winners to run while still requiring minimum profit before any close is considered.
- Honest Virtual Tracking: Average entry, total cost, deployed capital, and minimum-profit target are all computed from the same fill-by-fill bookkeeping a real broker would do. No price-from-base shortcuts.
- Webhook-First Design: Every event (base, each safety order, exit) emits a fully-formed JSON alert payload. Connect one alert to a DCA Bot's webhook URL and the indicator drives the bot end-to-end.
🔷 Considerations Before Using the Indicator:
Market & Timeframe: Designed for 3min crypto pairs with active mean-reversion behavior. Default RSI levels (31/69) are calibrated for liquid volatility; thin or strongly trending pairs may need recalibration.
Cross Detection Granularity: LTF RSI cross detection happens at host-bar close. A cross that completes and reverses inside a single host bar may be missed by design — this prevents over-signaling on intra-bar noise.
No Stop Loss: There is no exit signal on adverse moves beyond the safety-order ladder. Risk is structurally capped by the bounded position-size sequence — at default settings, base + all five safety orders deploy roughly 9.93% of equity, keeping the trade within the conventional 5–10% risk band. If a hard stop is required, layer it on the bot side.
Live vs Historical State: The virtual position state is rebuilt from the chart history each time the indicator is recompiled. If the indicator is added mid-trade 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. For performance metrics, use the companion strategy version on the same parameters.
🔷 How to Use It:
🔸 Add the indicator to a 3min crypto chart on the pair you want to trade.
🔸 Configure the order sizing inputs to match the DCA Bot's settings (base order size, first AO size, multipliers).
🔸 Set the entry RSI level (default 31) and exit RSI level (default 69) — these are the two RSI gates.
🔸 Set the minimum profit threshold (default 2.4%) — exits will not fire below this.
🔸 In the DCA Bot Webhook group, paste the Bot ID, Email Token, and Pair (QUOTE_BASE format, e.g., USDT_HYPE).
🔸 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 fully-formed JSON payloads for each event — no integration layer required.
🔷 INDICATOR SETTINGS
Base Order Size (USDT): USDT size of the initial entry. Used for the virtual avg-entry computation.
First AO Size (USDT): USDT size of the first safety order. Subsequent safety orders scale by the Size Multiplier.
Order Size Multiplier: Factor that grows each subsequent safety order's USDT size (default 1.25).
Averaging Orders per Trade: Maximum number of safety orders allowed per cycle (default 5).
Deviation to First AO (%): Distance from base entry where the first safety order becomes eligible (default 1.3%).
Deviation Step Multiplier: Ladder factor that widens each subsequent deviation step (default 1.3).
Entry RSI Timeframe / Length / Level: Lower-timeframe RSI configuration for the oversold cross-up entry (default 3m / 14 / 31).
Exit RSI Timeframe / Length / Level: Lower-timeframe RSI configuration for the overbought cross-down exit (default 3m / 14 / 69).
Minimum Profit (%): Threshold above the running average entry that must be reached before the exit signal can fire (default 2.4%).
DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload.
Visualization: Toggle the DCA Ladder, Signal Labels, Signal Triangles, Avg-Entry / Min-TP plots, and Status Table.
Brand Watermark: Configurable text, position (9 options), 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.