In MagicTradeBot, the price_deviation_percent is a critical DCA (Dollar Cost Averaging) setting that determines how far the price must move against your trade before the next DCA order is triggered.
Essentially, it defines the spacing between DCA orders, controlling when the bot averages down (for longs) or averages up (for shorts).
🔹 How price_deviation_percent Works
Initial Trade
The first order is placed at your entry price.
Subsequent DCA Orders
Each DCA order is triggered only if the price moves against your position by at least the specified
price_deviation_percent.
Example:
Settings:
max_orders: 3
price_deviation_percent: 5
Trade: Long BTC at $20,000
| Order | Trigger Price | Action |
|---|---|---|
| Initial | $20,000 | Buy $100 |
| DCA 1 | $19,000 (-5%) | Buy next DCA order |
| DCA 2 | $18,050 (-5% from previous) | Buy next DCA order |
- Each DCA order is only placed when price moves 5% further against the position.
🔹 How It Affects DCA Behavior
1️⃣ Order Frequency
- Smaller
price_deviation_percent→ DCA orders trigger more frequently - Larger
price_deviation_percent→ DCA orders are spaced further apart
Example for a long trade:
| Price Deviation | Number of DCA Orders Triggered (market drops 10%) |
|---|---|
| 2% | 5 orders (frequent averaging) |
| 5% | 2 orders (moderate averaging) |
| 10% | 1 order (sparse averaging) |
2️⃣ Risk Exposure
- Smaller deviations → more capital deployed faster → higher risk if trend continues against you
- Larger deviations → slower recovery, potentially missing favorable price points, but lower risk
3️⃣ Recovery Potential
- Smaller deviations reduce the average entry price faster because DCA orders are placed sooner
- Larger deviations require bigger price swings to trigger DCA, slowing average price reduction
🔹 Strategic Considerations
Asset Volatility
Highly volatile assets (e.g., meme coins) → larger deviation recommended to avoid excessive DCA orders
Low-volatility assets (e.g., BTC, ETH) → smaller deviation is safe and improves recovery
Trade Duration
Short-term trades → smaller deviation can help quickly recover adverse moves
Long-term trades → larger deviation is sufficient to catch major pullbacks
Budget & Risk Management
Always ensure total DCA exposure fits within your trade budget
- Combine with
max_orders,size_multiplier, andMaxLossPerTrade
🔹 Recommended Beginner Settings
| Asset Type | Suggested price_deviation_percent |
|---|---|
| BTC, ETH | 3–5% |
| Stable Altcoins | 2–4% |
| Meme Coins / High-Risk | 5–10% |
Smaller deviation triggers more frequent averaging, but increases exposure. Larger deviation reduces risk but may slow recovery.
🔹 Key Notes
- Applies to manual, signal-based, and auto trades
- Works for long and short positions
- Determines when DCA orders are triggered based on price movement
- Must be balanced with
size_multiplierandmax_ordersfor safe risk management
🏁 Final Summary
price_deviation_percent in MagicTradeBot controls:
- Spacing between DCA orders
- When the next averaging order is triggered
- Order frequency, capital deployment, and recovery speed
Properly setting
price_deviation_percentensures that DCA orders are placed at meaningful price levels, balancing recovery potential with risk exposure.