Table of Contents
- Overview
- Quick Start
- Configuration Reference
- How DCA Works
- Real-World Examples
- Best Practices
- Risk Management
- Troubleshooting
- FAQ
Overview
What is DCA?
Dollar Cost Averaging (DCA) is a trading strategy that automatically places additional orders at predetermined price levels when the market moves against your initial position. Instead of entering your entire position at once, DCA helps you:
- ✅ Lower your average entry price when buying dips (LONG)
- ✅ Improve your average entry price when selling rallies (SHORT)
- ✅ Reduce the impact of unfavorable entry timing
- ✅ Increase position size strategically as price moves in your favor direction
Key Benefits
| Benefit | Description |
|---|---|
| Better Average Entry | Multiple entries at different prices create a better overall entry point |
| Risk Distribution | Spread your capital across multiple price levels instead of all-in at once |
| Automatic Execution | Bot handles order placement based on your predefined rules |
| Position Scaling | Progressively increase position size with configurable multipliers |
| Profit Optimization | Lower average entry = higher profit potential when price reverses |
Important Concepts
- Parent Order: Your initial trade entry
- Child Orders: Additional DCA orders triggered by price movement
- Average Entry Price: Weighted average of all order entries (parent + children)
- Trigger Price: Price level that activates the next DCA order
Quick Start
Minimum Configuration
DCASettings:
enabled: true # Turn on DCA
max_orders: 4 # 1 parent + 3 DCA children
size_multiplier: 1.2 # Each order 20% larger than previous
price_deviation_percent: 5 # Trigger next order at 5% price movement
What This Does
- First Order (Parent): Places your initial trade at current price
- Second Order (Child 1): Triggers when price moves 5% against you, size = 1.2× parent
- Third Order (Child 2): Triggers at 5% below Child 1, size = 1.44× parent (1.2²)
- Fourth Order (Child 3): Triggers at 5% below Child 2, size = 1.728× parent (1.2³)
Example Scenario (LONG Trade)
Initial Entry: 100 units @ $10,000 = $1,000,000 invested
Price drops 5%: 120 units @ $9,500 = $1,140,000 invested
Price drops 5%: 144 units @ $9,025 = $1,299,600 invested
Price drops 5%: 172.8 units @ $8,574 = $1,481,587 invested
Total Position: 536.8 units
Total Invested: $4,921,187
Average Entry: $9,168 ✅ (vs $10,000 without DCA)
Breakeven: $9,168 (saved $832 per unit!)
Configuration Reference
Complete Configuration
#################################################
# 6. DCA Settings
#################################################
DCASettings:
enabled: true # Enable/disable DCA feature
max_orders: 4 # Maximum number of DCA orders (including initial)
size_multiplier: 1.2 # Multiplier for order size (1.0 = same, 1.2 = 20% larger)
price_deviation_percent: 5 # Price deviation % from last entry to trigger next order
Parameter Details
enabled
- Type: Boolean (true/false)
- Default: false
- Description: Master switch for DCA functionality
- Example:
enabled: true # DCA is active enabled: false # DCA is disabled (regular single-entry trades)
max_orders
- Type: Integer (1-10 recommended)
- Default: 1
- Description: Total number of orders including the parent trade
- Important:
max_orders = 1 parent + N children - Examples:
max_orders: 1 # No DCA (only parent order) max_orders: 3 # 1 parent + 2 DCA children max_orders: 4 # 1 parent + 3 DCA children (recommended) max_orders: 7 # 1 parent + 6 DCA children (aggressive)
size_multiplier
- Type: Decimal (0.1 - 5.0 recommended)
- Default: 1.0
- Description: How much larger each subsequent order should be
- Formula:
Order N size = Base size × multiplier^(N-1) - Examples:
size_multiplier: 1.0 # All orders same size size_multiplier: 1.2 # Each order 20% larger (recommended) size_multiplier: 1.5 # Each order 50% larger (aggressive) size_multiplier: 2.0 # Each order doubles in size (very aggressive) size_multiplier: 0.8 # Each order 20% smaller (pyramiding down)
price_deviation_percent
- Type: Decimal (0.1 - 20.0 recommended)
- Default: 5.0
- Description: Percentage price movement from last entry to trigger next order
- Direction:
- LONG trades: Triggers when price drops by this percentage
- SHORT trades: Triggers when price rises by this percentage
- Examples:
price_deviation_percent: 2 # Tight spacing (scalping, high volatility) price_deviation_percent: 5 # Medium spacing (recommended) price_deviation_percent: 10 # Wide spacing (swing trading, low volatility) price_deviation_percent: 15 # Very wide spacing (position trading)
How DCA Works
Order Placement Flow
┌─────────────────────────────────────────────────────────────┐
│ 1. PARENT ORDER PLACED │
│ Entry: $10,000 | Size: 100 units | Investment: $1M │
│ Trigger calculated: $10,000 × (1 - 0.05) = $9,500 │
└─────────────────────────────────────────────────────────────┘
↓
Price drops to $9,400
↓
┌─────────────────────────────────────────────────────────────┐
│ 2. CHILD ORDER 1 TRIGGERED │
│ Entry: $9,400 | Size: 120 units | Investment: $1.128M │
│ New avg entry: $9,686 │
│ Next trigger: $9,400 × 0.95 = $8,930 │
└─────────────────────────────────────────────────────────────┘
↓
Price drops to $8,900
↓
┌─────────────────────────────────────────────────────────────┐
│ 3. CHILD ORDER 2 TRIGGERED │
│ Entry: $8,900 | Size: 144 units | Investment: $1.282M │
│ New avg entry: $9,367 │
│ Next trigger: $8,900 × 0.95 = $8,455 │
└─────────────────────────────────────────────────────────────┘
↓
Price drops to $8,400
↓
┌─────────────────────────────────────────────────────────────┐
│ 4. CHILD ORDER 3 TRIGGERED │
│ Entry: $8,400 | Size: 172.8 units | Investment: $1.45M │
│ New avg entry: $9,168 │
│ Max orders reached - no more DCA orders │
└─────────────────────────────────────────────────────────────┘
Average Entry Calculation
The bot automatically calculates your average entry price:
Average Entry = Total Invested ÷ Total Quantity
Example:
Order 1: 100 × $10,000 = $1,000,000
Order 2: 120 × $9,400 = $1,128,000
Order 3: 144 × $8,900 = $1,281,600
Order 4: 172.8 × $8,400 = $1,451,520
─────────────────────────────────────
Total: 536.8 units = $4,861,120
Average Entry = $4,861,120 ÷ 536.8 = $9,056
Profit/Loss Calculation
All P&L calculations use the average entry price, not the initial entry:
Without DCA:
Entry: $10,000
Current: $9,500
P&L: -5.0% ❌
With DCA (4 orders):
Average Entry: $9,056
Current: $9,500
P&L: +4.9% ✅
Real-World Examples
Example 1: Conservative Swing Trading
Setup:
DCASettings:
enabled: true
max_orders: 3 # Small position
size_multiplier: 1.0 # Equal sizing
price_deviation_percent: 10 # Wide spacing
Trade Execution (LONG BTC):
Entry 1: 0.1 BTC @ $40,000 = $4,000
Price drops to $36,000 (10%)
Entry 2: 0.1 BTC @ $36,000 = $3,600
Price drops to $32,400 (10%)
Entry 3: 0.1 BTC @ $32,400 = $3,240
Total: 0.3 BTC for $10,840
Average Entry: $36,133
Breakeven: $36,133 (vs $40,000 without DCA)
Best For: Lower volatility assets, longer timeframes
Example 2: Aggressive Scalping
Setup:
DCASettings:
enabled: true
max_orders: 5 # More orders
size_multiplier: 1.5 # Aggressive scaling
price_deviation_percent: 2 # Tight spacing
Trade Execution (SHORT ETH):
Entry 1: 1 ETH @ $3,000 = $3,000
Price rises to $3,060 (2%)
Entry 2: 1.5 ETH @ $3,060 = $4,590
Price rises to $3,121 (2%)
Entry 3: 2.25 ETH @ $3,121 = $7,022
Price rises to $3,183 (2%)
Entry 4: 3.375 ETH @ $3,183 = $10,742
Price rises to $3,247 (2%)
Entry 5: 5.063 ETH @ $3,247 = $16,440
Total: 13.188 ETH for $41,794
Average Entry: $3,169
Breakeven: $3,169 (max loss if hits max orders)
Best For: High volatility assets, short timeframes ⚠️ Warning: Very high capital requirement!
Example 3: Balanced Approach (Recommended)
Setup:
DCASettings:
enabled: true
max_orders: 4 # Moderate depth
size_multiplier: 1.2 # Gradual scaling
price_deviation_percent: 5 # Medium spacing
Trade Execution (LONG SOL):
Entry 1: 100 SOL @ $100 = $10,000
Price drops to $95 (5%)
Entry 2: 120 SOL @ $95 = $11,400
Price drops to $90.25 (5%)
Entry 3: 144 SOL @ $90.25 = $12,996
Price drops to $85.74 (5%)
Entry 4: 172.8 SOL @ $85.74 = $14,816
Total: 536.8 SOL for $49,212
Average Entry: $91.68
Breakeven: $91.68 (8.3% better than initial)
Price rebounds to $95:
Profit: 536.8 × ($95 - $91.68) = $1,782 (3.6% gain)
Without DCA: 100 × ($95 - $100) = -$500 (5% loss)
Best For: Most trading scenarios, balanced risk/reward
Best Practices
1. Capital Management
Reserve Enough Capital
Calculate maximum capital needed:
Base Order: $10,000
Multiplier: 1.2
Max Orders: 4
Order 1: $10,000
Order 2: $12,000 (1.2×)
Order 3: $14,400 (1.2²×)
Order 4: $17,280 (1.2³×)
─────────────────
Total: $53,680 ⚠️ Need 5.4× your initial order size!
Rule of Thumb:
- Equal sizing (1.0): Need
max_orders × initial_size - 1.2× multiplier: Need ~5× initial size for 4 orders
- 1.5× multiplier: Need ~10× initial size for 4 orders
- 2.0× multiplier: Need ~15× initial size for 4 orders
Account Balance Safety
# Keep 20-30% buffer for unexpected opportunities
Available Balance: $100,000
Reserve for DCA: $70,000
Safety Buffer: $30,000
2. Choosing the Right Settings
By Market Conditions
High Volatility (BTC, ETH during news):
max_orders: 5
size_multiplier: 1.3
price_deviation_percent: 3
Medium Volatility (Major altcoins):
max_orders: 4
size_multiplier: 1.2
price_deviation_percent: 5
Low Volatility (Stablecoins, mature markets):
max_orders: 3
size_multiplier: 1.1
price_deviation_percent: 2
By Timeframe
Scalping (minutes):
price_deviation_percent: 1-2
max_orders: 3-4
size_multiplier: 1.3-1.5
Day Trading (hours):
price_deviation_percent: 3-5
max_orders: 3-5
size_multiplier: 1.2-1.3
Swing Trading (days):
price_deviation_percent: 5-10
max_orders: 3-4
size_multiplier: 1.0-1.2
Position Trading (weeks):
price_deviation_percent: 10-15
max_orders: 2-3
size_multiplier: 1.0-1.1
By Account Size
Small Account (<$10,000):
max_orders: 3 # Limited capital
size_multiplier: 1.0 # Can't scale aggressively
price_deviation_percent: 7
Medium Account ($10,000-$100,000):
max_orders: 4
size_multiplier: 1.2
price_deviation_percent: 5
Large Account (>$100,000):
max_orders: 5-7
size_multiplier: 1.3-1.5
price_deviation_percent: 3-5
3. Exit Strategy
Take Profit Targets
With DCA average entry improvement:
- Set TP at +5% from average entry (not initial entry!)
- Consider partial profit taking at psychological levels
- Trail stop loss as profit increases
Stop Loss Management
Options:
1. No stop loss - let DCA work (risky!)
2. Stop loss at -X% from average entry
3. Stop loss at -X% from last DCA order
4. Max drawdown limit (e.g., 20% total account)
4. Monitoring
Check These Regularly:
- ✅ Current number of DCA orders active
- ✅ Average entry price vs current price
- ✅ Total capital invested
- ✅ Distance to next DCA trigger
- ✅ Remaining capital available
Bot Logs to Watch:
✅ "DCA trigger hit" - New order placed
✅ "Parent trade updated with DCA data" - Average recalculated
✅ "Max orders reached" - No more DCA orders possible
⚠️ "Insufficient balance" - Need more capital!
Risk Management
Maximum Drawdown Scenarios
Scenario: 4 Orders, 1.2× Multiplier, 5% Spacing
| Orders Filled | Price Drop | Capital Used | Max Drawdown |
|---|---|---|---|
| 1 (Parent) | 0% | $10,000 | 0% |
| 2 | -5% | $22,000 | -2.5% |
| 3 | -9.75% | $36,400 | -5.1% |
| 4 (Max) | -14.26% | $53,680 | -7.8% |
Interpretation:
- Even with 4 DCA orders triggered, max drawdown is only 7.8%
- Without DCA: 14.26% loss at same price level
- DCA reduced drawdown by ~50%!
Capital Requirements by Configuration
| Config | Initial | Max Capital | Multiplier Effect |
|---|---|---|---|
| 3 orders, 1.0× | $10k | $30k | 3.0× |
| 3 orders, 1.2× | $10k | $34.4k | 3.4× |
| 4 orders, 1.0× | $10k | $40k | 4.0× |
| 4 orders, 1.2× | $10k | $53.7k | 5.4× |
| 5 orders, 1.2× | $10k | $71.1k | 7.1× |
| 4 orders, 1.5× | $10k | $88.1k | 8.8× |
| 5 orders, 1.5× | $10k | $181.9k | 18.2× |
⚠️ Critical: Always maintain 1.5-2× the max capital needed for safety!
Risk Mitigation Strategies
1. Position Size Limits
# Start small!
InitialTradeAmount: 100 # Not 1000
DCASettings:
max_orders: 3 # Not 7
size_multiplier: 1.1 # Not 2.0
2. Per-Symbol Limits
Don't DCA every trade:
- Reserve DCA for high-confidence setups
- Use single entries for uncertain trades
- Limit concurrent DCA positions (max 2-3)
3. Time-Based Limits
Prevent rapid-fire DCA in flash crashes:
- Minimum time between orders: 5-15 minutes
- Daily DCA limit: Max 10 DCA activations per day
- Review trades if multiple DCA chains trigger same day
4. Volatility-Based Adjustments
High volatility detected:
- Widen price_deviation_percent (5% → 7%)
- Reduce max_orders (4 → 3)
- Lower size_multiplier (1.2 → 1.1)
Troubleshooting
DCA Orders Not Triggering
Symptom: Price moves but no DCA orders placed
Possible Causes:
DCA not enabled
# Check: DCASettings: enabled: true # ← Must be true!Max orders already reached
# Check logs: "Max orders reached" or "dca_total_orders >= dca_max_orders" # Solution: Trade is complete, wait for exit or new entryTrigger price not reached
# Check logs for: "DCA trigger check: current_price=X trigger_price=Y" # LONG: Triggers when current_price <= trigger_price # SHORT: Triggers when current_price >= trigger_price # Solution: Wait for price to move furtherInsufficient balance
# Check logs: "Failed to place order" or "Insufficient balance" # Solution: Add more capital or reduce DCA settings
DCA Orders Triggering Too Frequently
Symptom: Multiple DCA orders within seconds/minutes
Possible Causes:
price_deviation_percent too small
# Current: price_deviation_percent: 0.5 # ❌ Too tight! # Fix: price_deviation_percent: 5 # ✅ More reasonableFlash crash / extreme volatility
# All triggers hit at once - this is normal! # Orders 2, 3, 4 all trigger if price gaps down >15% # Prevention: Use wider spacing in volatile markets
Incorrect Average Entry Price
Symptom: Average entry doesn't match expectations
Check:
Logs should show:
"Parent trade updated with DCA data"
avg_entry=X total_quantity=Y total_invested=Z
Manual calculation:
Average = total_invested ÷ total_quantity
If mismatch, check:
1. All child orders saved to database?
2. Parent trade updated after each child?
3. Any failed order placements?
DCA Not Improving Entry
Symptom: DCA average entry worse than single entry
This happens when:
Price reverses after first DCA order:
Entry 1: $100 (100 units)
Entry 2: $95 (120 units) ← DCA triggered
Price now: $98
Without DCA: -2% ($100 → $98)
With DCA: -1.4% ($96.36 avg → $98) ✅ Still better!
But if price is back at $100:
Without DCA: 0% (breakeven)
With DCA: +3.8% ($96.36 → $100) ✅ In profit!
This is expected behavior - DCA shines when price reverses!
FAQ
Q1: Can I use DCA with money management strategies?
A: Yes! DCA works alongside money management:
Base size from money management: $10,000
DCA multiplier: 1.2
Result:
- Order 1: $10,000 (from MM)
- Order 2: $12,000 (DCA multiplier applied)
- Order 3: $14,400
Q2: What happens to TP/SL with DCA?
A:
- TP/SL levels are calculated from original entry initially
- P&L calculation uses average entry price
- This means you may hit TP sooner than expected! ✅
Original TP: +5% from $100 = $105
Average entry after DCA: $95
Current price: $102
Without DCA: +2% (not at TP yet)
With DCA: +7.4% (TP hit!) ✅
Q3: Should I use DCA on every trade?
A: No! Use DCA selectively:
Good for DCA:
- ✅ High-confidence setups
- ✅ Strong support/resistance levels
- ✅ Following the trend
- ✅ High liquidity pairs
Bad for DCA:
- ❌ Low conviction trades
- ❌ News-driven volatility
- ❌ Breakout trades (may keep running)
- ❌ Low liquidity pairs
- ❌ Short-term scalps
Q4: Can I manually close a DCA position?
A: Yes, closing the parent trade will close the entire DCA sequence.
Q5: What if I run out of capital mid-DCA?
A: The bot will log an error and stop placing new DCA orders. Existing orders remain active. To prevent this:
1. Calculate max capital needed beforehand
2. Set TradeAmountPer to leave buffer:
TradeAmountPer: 15 # Use only 15% of balance
# With $100k balance = $15k per trade
# With 4 DCA orders = ~$80k max needed
# Still leaves $20k buffer ✅
Q6: How do I test DCA without risking capital?
A:
# Use demo mode:
general:
demo_mode: true
DCASettings:
enabled: true
max_orders: 4
size_multiplier: 1.2
price_deviation_percent: 5
Or use the simulation mode (run cargo run --bin dca_simulator)
Q7: Can I change DCA settings while trades are open?
A: Config changes apply to NEW trades only. Existing DCA sequences continue with their original settings.
Q8: What's the optimal size_multiplier?
A: Depends on your goal:
| Multiplier | Style | Risk | Capital | Best For |
|---|---|---|---|---|
| 1.0 | Conservative | Low | 3-4× | Beginners, uncertain markets |
| 1.1-1.2 | Balanced | Medium | 4-6× | Most traders (recommended) |
| 1.3-1.5 | Aggressive | High | 7-12× | Experienced, high conviction |
| 1.5-2.0 | Very Aggressive | Very High | 12-20× | Pros only, strong setups |
Q9: Why did my DCA order place at a different price?
A: Market orders fill at current market price. In volatile markets:
Trigger: $9,500
Order placed: $9,502 (market moved up)
This is normal! DCA uses trigger as "around this level"
Use limit orders if precise entries are critical (may result in missed fills).
Q10: Can I use different DCA settings per symbol?
A: Currently, DCA settings are global. Workaround:
1. Use multiple bot instances
2. Each with different config
3. Assign specific symbols to each bot
Summary
Quick Decision Matrix
| Your Scenario | Recommended Config |
|---|---|
| New to DCA | max_orders: 3, multiplier: 1.0, deviation: 5% |
| Experienced trader | max_orders: 4, multiplier: 1.2, deviation: 5% |
| High volatility | max_orders: 5, multiplier: 1.3, deviation: 3% |
| Low volatility | max_orders: 3, multiplier: 1.1, deviation: 2% |
| Small account | max_orders: 3, multiplier: 1.0, deviation: 7% |
| Large account | max_orders: 5, multiplier: 1.5, deviation: 3% |
| Scalping | max_orders: 3, multiplier: 1.5, deviation: 1-2% |
| Swing trading | max_orders: 4, multiplier: 1.2, deviation: 5-10% |
Final Checklist
Before enabling DCA, ensure:
- [ ] You understand total capital requirements
- [ ] Account balance covers max_orders × size_multiplier
- [ ] Settings appropriate for market volatility
- [ ] You've tested in demo mode first
- [ ] Stop loss / take profit strategy defined
- [ ] You monitor DCA positions regularly
- [ ] You have a plan for max drawdown scenarios