In MagicTradeBot, the max_orders parameter is a fundamental setting in the DCA (Dollar Cost Averaging) engine. It defines the maximum number of orders the bot can place for a single trade, including the initial entry order.
This setting controls exposure, capital allocation, and how aggressively the bot averages down or up when the market moves against your position.
๐น How max_orders Works
Initial Order
- The first order is always considered the initial trade entry.
Additional DCA Orders
- If price moves against the trade, the bot can place additional orders.
- The total number of DCA orders, including the initial order, cannot exceed
max_orders.
Example:
max_orders: 3
- Initial order = 1
- DCA order 1 = 2
- DCA order 2 = 3
Once the bot reaches the 3rd order, no more DCA orders will be placed for that trade.
๐น Why max_orders Is Important
max_orders directly affects:
1๏ธโฃ Risk Exposure
- More orders โ higher capital deployed โ higher potential loss if price continues against you.
- Fewer orders โ smaller exposure โ lower risk but slower recovery.
2๏ธโฃ Average Price Reduction
- Higher
max_ordersallows more averaging steps, lowering average entry price incrementally. - Lower
max_orderslimits the averaging potential.
3๏ธโฃ Budget Allocation
MagicTradeBot calculates the initial order size based on:
- Total budget per trade
- Multiplier
max_orders
This ensures that even with multiple DCA orders, the total capital spent does not exceed your allocated trade budget.
๐น Example Scenario
Trade Budget: $1,000 Max Orders: 3 Multiplier: 1.2
| Order | Amount (calculated automatically) |
|---|---|
| Initial | $370 |
| DCA 1 | $444 |
| DCA 2 | $532 |
Total allocated = $1,346 (within adjusted calculation logic, bot ensures it stays under the total trade budget).
The bot ensures the last DCA order never exceeds max_orders, preventing overexposure.
๐น Strategic Considerations
Low
max_orders(2โ3):- Conservative approach
- Less capital at risk
- Suitable for high-volatility assets or limited capital
High
max_orders(5+):- Aggressive averaging
- More recovery potential
- Requires careful planning of multiplier and total budget
Always test your DCA configuration across different market conditions.
๐น Key Notes
max_ordersapplies to both long and short trades.- Works for manual trades, signal-based trades, and auto trades (if DCA is enabled).
- A small misconfiguration can increase risk significantly if price moves continuously against you.
- Combining
max_orderswith MaxLossPerTrade and SmartTP helps control risk while maximizing profit potential.
๐ Final Summary
max_orders in MagicTradeBotโs DCA settings:
- Defines the total number of orders per trade, including the initial entry
- Controls risk exposure and capital allocation
- Determines how many averaging steps the bot can perform
- Works in manual, signal-based, and auto-trading modes
- Must be planned carefully alongside multiplier, total budget, and risk rules
It is a critical setting to balance recovery potential and capital safety in DCA trading.
If you want, I can also create a visual table showing how max_orders affects average price progression for both long and short trades โ it makes the concept very intuitive.