BTC DCA Strategy [3Commas & QuantPilot] by 3Commas
By 3Commas
Performance Metrics
- Author: 3Commas
- Symbol: BYBIT:BTCUSDT.P
- Timeframe: 4 hours
- Win Rate: 76.3%
- Profit Factor: 10.454
Description
BTC Smart DCA Strategy [3Commas & QuantPilot]🔷 What it does:This is a long-only DCA (Dollar-Cost Averaging) strategy for BTC / USDT that opens a position only in oversold conditions and then averages down on a fixed safety-order ladder. A base order fires when 4h RSI(14) drops below the entry threshold; if price keeps falling, five averaging orders add to the position at fixed deviations from the base entry, each larger than the last. The full position is closed at a fixed take-profit above the blended average entry. There is no trailing exit and no stop loss — the position is structurally bounded by the five-order ladder. - Single entry filter: 4h RSI(14) below 38 (oversold). - Five averaging orders at fixed deviations (−2%, −5%, −9.5%, −16%, −25%) with 1.8× size scaling per rung. - Fixed take-profit (5.5%) on the blended average entry; no trailing, no stop loss. - Every fill and close emits a webhook-ready JSON alert payload for a DCA Bot.🔷 What changed — two parameters, tuned with QuantPilot:This strategy started from a baseline configuration (RSI entry below 28, 3% take-profit). Running the same script, on the same market, over the same period through the QuantPilot Pine Script optimizer, two parameters were swept and re-selected: the RSI entry threshold moved from 28 to 38, and the take-profit moved from 3% to 5.5%. Everything else was left untouched — same five-order ladder, same deviations, same 1.8× sizing, same fees. - Baseline (RSI < 28, TP 3%): Net +3,078.29 USDT (+3.08%), Max Drawdown 3.79%, 62 closed trades, 70.97% profitable, Profit Factor 4.028. - Optimized (RSI < 38, TP 5.5%): Net +9,250.25 USDT (+9.25%), Max Drawdown 3.67%, 93 closed trades, 76.34% profitable, Profit Factor 10.454. The result: net profit roughly 3× higher (+3.08% → +9.25%), profit factor up from 4.0 to 10.5, win rate up from 71% to 76% — all while maximum drawdown stayed essentially flat (3.79% → 3.67%). The looser RSI entry (38) lets the strategy engage the dip earlier and more often, while the wider 5.5% target lets each recovery run further before the position is banked. The published defaults use the optimized values; the baseline metrics are shown here purely so the effect of the two parameter changes is transparent.🔷 Who is it for: - Swing traders accumulating BTC on RSI pullbacks rather than chasing momentum. - Bot operators who want a chart-driven signal source with base / safety-order / close webhook JSON ready to drive a DCA Bot. - Traders comfortable with martingale-style averaging who size their capital to the worst-case ladder fill. - Range / mean-reversion traders who prefer mechanical oversold entries over discretionary timing.🔷 How does it work: Entry (Base Order): On each closed 4h bar the strategy reads RSI(14). When RSI falls below 38 and there is no open position, it opens the base order at market (or limit, optionally) and dispatches the entry webhook. Averaging Orders: Once in a position, the strategy watches price relative to the original base entry. The five safety orders are armed at fixed deviations from that base entry — not cumulatively — at −2%, −5%, −9.5%, −16%, and −25%. As each threshold is crossed on bar close, the corresponding averaging order fires. Order sizes scale 1.8× per rung ($900 → $1,620 → $2,916 → $5,249 → $9,448 from a $500 base), pulling the blended average entry down toward the latest fill. Exit (Take Profit): While in a position, the strategy computes a take-profit price 5.5% above the current average entry. When price closes at or above that level, the entire position is closed at market and the close webhook fires. There is no trailing and no stop loss. Capital Bounds: Total deployed capital cannot exceed the base order plus the five safety orders. Once all five averaging orders are filled, no further adds occur — the position simply waits for the take-profit. This ladder cap is the strategy's primary risk control.🔷 Why it's unique: - Optimizer-Tuned Parameters: The RSI threshold (38) and take-profit (5.5%) are not arbitrary — they are the values the QuantPilot Pine Script optimizer selected as best-performing on the historical sample, with every other parameter held constant. - Fixed-Deviation Martingale Ladder: Safety orders are placed at fixed percentages from the base entry with deliberate 1.8× size scaling, so each rung has progressively more influence on the average — a transparent, fully-specified averaging schedule rather than an opaque adaptive grid. - Full Webhook Chain: Base order, each safety order, and the close all emit dedicated JSON payloads, driving a DCA Bot end-to-end with no glue layer. - On-Chart Transparency: The AO ladder, average entry, and take-profit target are plotted live, and the status table reports RSI, AOs filled, base/average entry, TP target, and max deployable capital.🔷 Considerations Before Using the Strategy: Optimization / Overfitting Risk: The RSI threshold and take-profit were selected by sweeping those parameters over the same historical window shown in the results. Values that were best in-sample are not guaranteed to be best out-of-sample — this is the standard caveat for any optimized parameter. Treat the optimized metrics as the ceiling of what this configuration achieved historically, not as a forward expectation, and re-validate on fresh data before committing capital. Trade Volume — Near the Statistical Floor: The optimized configuration produced 93 closed trades over ~30 months (62 on the baseline). This is approaching but still below the ~100-trade threshold often used as a floor for statistical relevance, so treat the win rate and the high profit factor as indicative rather than conclusive. Martingale Tail Risk: Order sizes scale 1.8× per rung, so the deepest fills are by far the largest. If BTC trends hard below the −25% AO5 level without recovering to take-profit, the position sits fully loaded with no further adds and no stop — unrealized loss can grow until price reverts. No Stop Loss Justification: There is no exit on adverse moves. Per-order risk is bounded by the fixed ladder allocation; aggregate exposure is capped at base + five AOs (≈ $20,633 on the default $100k account, ~20.6% of equity). Size the base/AO inputs down to match the worst-case exposure you are willing to hold. Fees: The default commission (0.06% per trade) should be matched to your exchange's actual taker fees. Demo Testing: Always demo-test before going live. Past results do not guarantee future performance, particularly for martingale-style averaging strategies whose risk profile is dominated by rare deep drawdowns.🔷 STRATEGY PROPERTIES Symbol: BYBIT:BTCUSDT.P (Perpetual) — strategy is portable to any BTC / USDT pair. Timeframe: 4H (RSI sampled on 4h). Test Period: January 1, 2024 — July 17, 2026 (~30 months). Initial Capital: 100,000 USDT. Base Order Size: 500 USDT. Averaging Orders: 5, at −2% / −5% / −9.5% / −16% / −25% from base entry. AO Sizing: 1.8× per rung — 900 / 1,620 / 2,916 / 5,249 / 9,448 USDT. Max Deployed Capital: ≈ 20,633 USDT (~20.6% of equity, all AOs filled). Commission: 0.06% per trade. Slippage: 3 ticks. Entry Filter: 4h RSI(14) below 38 (optimizer-tuned from 28). Take Profit: 5.5% above average entry (optimizer-tuned from 3%). Stop Loss: None — ladder allocation is the structural risk cap. Trailing: None. Strategy: Long Only.🔷 STRATEGY RESULTS (Optimized — RSI < 38, TP 5.5%) ⚠️ Remember, past results do not guarantee future performance. Net Profit: +9,250.25 USDT (+9.25%) Max Equity Drawdown: 3,980.36 USDT (3.67%) Total Closed Trades: 93 Percent Profitable: 76.34% (71 / 93) Profit Factor: 10.454🔷 STRATEGY RESULTS (Baseline — RSI < 28, TP 3%, for comparison) Net Profit: +3,078.29 USDT (+3.08%) Max Equity Drawdown: 3,852.12 USDT (3.79%) Total Closed Trades: 62 Percent Profitable: 70.97% (44 / 62) Profit Factor: 4.028🔷 How to Use It: 🔸 Adjust Settings: Open the strategy inputs and confirm the RSI level (default 38), the five AO deviations and sizes, and the Take Profit (default 6%) match your risk profile. Scale the base/AO sizes down for lower exposure. 🔸 Results Review: Run a full-period backtest and confirm Max Drawdown stays within your personal risk band — note the optimized configuration reached 3.67%. Keep in mind the 93-trade sample is just below the ~100-trade floor for statistical confidence, and the high profit factor reflects that small, optimized sample. 🔸 Create alerts to trigger the DCA Bot: Add one alert on the strategy using "Any alert() function call". Paste your 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 base order, each safety order, and the close will each emit a dedicated JSON payload.🔷 INDICATOR SETTINGS Base Order Size: Capital committed on the first (base) entry. AO Deviations: Fixed percentage distances from the base entry where each safety order fires. AO Sizes: Capital per safety order (1.8× scaling by default). RSI Timeframe / Length / Level: Oversold filter for the base entry (default 4h, 14, below 38 — optimizer-tuned). Take Profit (%): Distance above average entry where the full position closes (default 5.5%, optimizer-tuned). Bot ID / Email Token / Pair: Webhook fields injected into every alert payload. Visualization: Toggle the AO ladder, fill labels, avg/TP lines, and 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.