RSI Dip + EMA Trend Long DCA - Strategy by 3Commas

By 3Commas

Performance Metrics

Description

RSI Dip + EMA Trend Long DCA β€” Leveraged StrategyπŸ”· What it does:This is a long-only DCA strategy on leveraged crypto perpetuals that buys oversold dips inside confirmed uptrends. A long entry opens only when the lower-timeframe RSI crosses down into oversold territory AND a higher-timeframe EMA cross confirms the larger trend is up. Four safety orders form a pure-price deviation ladder. Exit is a tight Take Profit with trailing, OR a hard Stop Loss, OR a forced close after a maximum holding period. - Single base order with up to four safety orders, soft 1.05Γ— size compounding. - Dual confirmation entry: RSI(12) crossing down 35 on 5m AND EMA(50) > EMA(100) on 15m. - Three exit paths: 1.0% Take Profit with 0.1% trailing, 9% hard Stop Loss, or forced market close after 3 days max hold. - Default leverage 25Γ— β€” per-trade realized risk ~7.17% of equity (inside the 5–10% band). - Every entry, safety order, and exit emits a webhook-ready JSON alert payload for direct DCA Bot consumption.πŸ”· Who is it for: - Active traders comfortable with leveraged crypto perpetuals who want a systematic dip-buying engine inside confirmed uptrends. - Bot operators who want a chart-driven signal source with per-event JSON ready for a DCA Bot configured for leveraged futures. - Traders looking to combine momentum exhaustion (RSI dip) with trend confirmation (EMA stack) for higher-confidence entries. - Portfolio operators who can absorb a 15–20% maximum drawdown in exchange for ~30% trailing returns over comparable periods.πŸ”· How does it work: Entry RSI Filter (Oversold Dip): A 5-minute RSI(12) is sampled via request.security with lookahead disabled. The dip gate fires when RSI crosses down through 35 β€” momentum has rolled over into oversold, which on a confirmed uptrend often marks a tactical bounce point. EMA Trend Filter: A 15-minute EMA(50) and EMA(100) are sampled in parallel. The trend gate is satisfied only while Fast EMA > Slow EMA β€” the broader trend is up. When the EMA cross flips, the dip signal alone cannot open a trade. Entry: When both gates align at host-bar close, a long position opens. Base order is configurable as Market (default) or Limit. With default 25Γ— leverage, base margin Γ— leverage = notional position size. Safety Order Ladder: After base fill, the strategy monitors price deviation downward against the position. No additional gating β€” pure price ladder. The k-th safety order fires when close ≀ base entry Γ— (1 βˆ’ cumulative deviation), where cumulative deviation grows by the step multiplier (default 1.2): 1.00%, 2.20%, 3.64%, 5.37%. Each safety order's USDT margin grows by 1.05Γ— β€” soft compounding. Exit Priority: Three exit paths evaluated in order on each bar: (1) Stop Loss at 9% below average entry, (2) Maximum Hold timeout at 3 days from base entry, (3) Take Profit at 1% above average entry with 0.1% trailing β€” once price reaches the TP target, the position closes only after a 0.1% retrace from the in-favor peak.πŸ”· Why it's unique: - Two-Layer Confirmation: RSI(12) dip on 5m for entry timing, EMA(50/100) on 15m for trend bias. The two filters operate on different scales β€” momentum exhaustion alone cannot open a trade against a confirmed downtrend, and trend alignment alone cannot open a trade outside a tactical entry window. - Three-Exit Architecture: Hard Stop Loss for tail-risk protection, Maximum Hold timeout for stuck trades that don't reach either bound, and Take Profit with trailing for letting winners run. Most DCA strategies use one or two exits; this one explicitly handles all three failure modes. - Leverage-Aware Sizing: Base margin and leverage are independent inputs. Margin sets the per-trade capital commitment; leverage sets the notional exposure. Per-trade risk at SL = base + SO margins Γ— SL% β€” bounded and predictable. - DCA Bot Integration: Every event (base, SO 1–4, TP/SL/MaxHold close) emits a fully-formed JSON alert payload. Connect one alert to a DCA Bot's webhook URL and the strategy drives the bot end-to-end.πŸ”· Considerations Before Using the Strategy: Market & Timeframe: Defaults are calibrated for BYBIT:XMRUSDT perpetual on 15m. The dip-buying-in-uptrend logic is portable to other liquid crypto perpetuals with clear directional regimes, but the EMA periods and RSI thresholds should be reviewed before redeployment. Leverage Warning: The default 25Γ— leverage is aggressive. A 9% adverse price move at 25Γ— leverage equals 225% of base margin β€” the Stop Loss closes the position at full margin loss before liquidation. The per-trade realized risk at SL is approximately 7.17% of equity at default base margin (60 USDT). Lower the leverage input or reduce base margin to dial down per-trade exposure. Drawdown Profile: The backtest produced a 18.01% maximum equity drawdown over a 14-month sample with 779 closed trades. This is above TradingView's typical 5–10% per-trade band β€” but the figure reflects portfolio-level accumulation of losing trades across an adverse period, not single-trade risk. Per-trade risk remains inside the 5–10% band; the portfolio-level DD reflects the leveraged compounding and should be sized accordingly within a diversified strategy mix. No SO Condition: Safety orders fire on pure price ladder with no momentum gate. This means averaging continues unconditionally as price drops, until either SL fires or the price reverses. The trade-off: higher average-entry quality if the dip continues, but greater unrealized loss exposure during sharp drops. Maximum Hold Period: The 3-day forced close exists to release capital from stuck trades that haven't reached TP or SL. On a 15m chart, this is approximately 288 bars. Adjust the timeout to match your strategy rotation cadence. Funding Rates (Perpetuals): Backtests do not account for perpetual funding rates. Sustained negative funding (shorts pay longs) improves live performance for this long strategy; sustained positive funding degrades it. Review the historical funding pattern before live deployment. Demo Testing: Always demo-test before going live. Past results do not guarantee future performance, especially on leveraged strategies where small parameter changes materially affect risk.πŸ”· STRATEGY PROPERTIES Symbol: BYBIT:XMRUSDT.P (Perpetual) Timeframe: 15M Test Period: April 1, 2025 β€” May 26, 2026 (~14 months). Initial Capital: 10,000 USDT. Order Size per Trade: 60 USDT margin Γ— 25Γ— leverage = 1,500 USDT notional base + 4 safety orders at 1.05Γ— progression. Max Capital Deployed (Margin): ~318.6 USDT per trade across base + 4 SOs. Max Realized Loss per Trade: ~717 USDT at full ladder + SL (~7.17% of equity). Commission: 0.05% per trade. Slippage: 3 ticks. Leverage: 25Γ— (configurable). Margin for Long Positions: 100%. Indicator Settings: Default Configuration. Base Order: 60 USDT margin, Market by default (Limit toggle available). Take Profit: 1.0% above average entry with 0.1% trailing. Stop Loss: 9% below average entry (hard close). Max Hold: 3 days (259,200 seconds) β€” forced market close. Entry Filter: 5m RSI(12) Crossing Down 35 AND 15m EMA(50) > EMA(100). Safety Orders: 4, Deviation 1.0%, Deviation Step 1.2Γ—, Size Multiplier 1.05Γ—. Strategy: Long Only.πŸ”· STRATEGY RESULTS ⚠️ Remember, past results do not guarantee future performance. Net Profit: +3,078.80 USDT (+30.79%) Max Equity Drawdown: 2,013.77 USDT (18.01%) Total Closed Trades: 779 Percent Profitable: 74.07% (577 / 779) Profit Factor: 1.313πŸ”· How to Use It: πŸ”Έ Adjust Settings: Open the strategy inputs and review the Base Margin, Leverage, entry filter (RSI level on 5m, EMA periods on 15m), the 4-SO ladder, and the three exit conditions. Defaults are calibrated for XMRUSDT.P 15m at 25Γ— leverage β€” recalibrate per asset and per risk profile before deploying. πŸ”Έ Results Review: Run a full-period backtest and confirm Max Drawdown stays inside your personal risk band. The 18% DD at default settings reflects 25Γ— leverage β€” lower the leverage input to scale risk down proportionally. Validate the closed-trade count (β‰₯ 100 minimum is a comfortable statistical floor). πŸ”Έ Create alerts to trigger the DCA Bot: Add one alert on the strategy using "Any alert() function call". Paste the DCA Bot's webhook URL into the alert's Webhook field, and fill the Bot ID, Email Token, and Pair inputs on the script. The strategy will emit JSON payloads for entry, each safety order, and all three exit types β€” formatted for direct DCA Bot consumption.πŸ”· INDICATOR SETTINGS Base Order Margin (USDT): Margin per base trade. Notional = Margin Γ— Leverage. Leverage (Γ—): Exchange leverage. Default 25Γ— β€” adjust to match your account configuration. Use LIMIT for Base: Toggle between Market (default) and Limit at bar close. Max Safety Orders: Maximum number of safety orders per deal (default 4). First SO Margin (USDT): USDT margin of the first safety order; subsequent SOs scale by the Size Multiplier. Step to First SO (%): Distance from base entry at which SO1 becomes eligible. Step Multiplier: Ladder factor that widens each subsequent deviation step. Size Multiplier: Factor that grows each subsequent safety order's USDT margin. Entry RSI Timeframe / Length / Level: Lower-timeframe RSI oversold-dip filter. EMA Timeframe / Fast / Slow: Higher-timeframe trend confirmation filter. Take Profit (%) / Trailing Deviation (%): TP target above avg entry and trailing buffer. Stop Loss (%): Hard stop below avg entry. Force Close After Max Hold / Max Hold (seconds): Timeout for forced market close. DCA Bot Webhook: Bot ID, Email Token, and Pair fields injected into every alert payload. Visualization: Toggle SO Ladder, Avg / TP / SL plot lines, fill labels, 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.

Browse all 5,900+ TradingView Pine Script strategies

View on TradingView