Automatic DCA position size calculation in MagicTradeBot is a feature that automatically determines the size of both the initial order and all subsequent DCA orders based on your account balance, total risk limits, and configured DCA parameters. This automation ensures that your total exposure per trade remains controlled, reducing the likelihood of over-leveraging or excessive risk.
๐น 1๏ธโฃ How It Works
Evaluate Account Balance
- MagicTradeBot checks your available balance in live mode
- For demo/testing, you can also set a fixed balance value
Apply Total Investment Percentage
total_percent_investment_per_tradedefines the maximum portion of your balance allocated across all DCA orders for a single trade- Example: 2% of a $1,000 account โ total exposure = $20
Determine Initial Order Size
If
auto_calculate_initial_amountis enabled:- Bot automatically calculates initial order size as a fraction of total DCA exposure
- If disabled, it uses the
InitialAmountspecified in trading.yaml
Calculate DCA Orders
Subsequent orders are sized according to:
size_multiplier(e.g., 1.2)- Remaining available exposure based on max orders
- Ensures total DCA exposure does not exceed total_percent_investment_per_trade
Dynamic Adjustment
- In volatile markets, as DCA orders are triggered, the average entry price and total exposure are continuously updated
๐น 2๏ธโฃ Example Workflow
Assume a $1,000 account with the following DCA settings:
auto_calculate_initial_amount: true
total_percent_investment_per_trade: 3
max_orders: 2
size_multiplier: 1.2
Step 1 โ Initial Order
- Total DCA allocation = 3% of $1,000 = $30
- Initial order size = $30 รท (1 + 1.2) โ $13.64
Step 2 โ First DCA Order
- Size = Initial ร 1.2 โ $16.36
Total Exposure
- $13.64 + $16.36 = $30 (matches total risk limit)
The bot ensures precise exposure control while scaling DCA orders automatically.
๐น 3๏ธโฃ Key Benefits
Risk Control
- Automatically keeps total exposure within defined percentage of account balance
Ease of Use
- No need to manually calculate order sizes for multiple DCA orders
Consistency
- Ensures DCA scaling is consistent across trades and symbols
Adaptive to Market Changes
- Automatically recalculates based on real-time balance and triggered DCA orders
๐น 4๏ธโฃ Key Takeaways
- Automatic DCA position size calculation removes manual guesswork
- Ensures total exposure stays controlled while allowing DCA orders to scale
Works in conjunction with:
max_orderssize_multipliertotal_percent_investment_per_trade
- Essential for safe, systematic DCA execution, especially for beginners or when trading multiple symbols
In short, this feature balances risk, automation, and profitability, letting MagicTradeBot handle precise DCA order sizing while you focus on strategy and monitoring.
๐ Related Topics
- Why is position size calculation important when using DCA strategies?
- How does this feature differ from fixed initial trade amounts?
- Does this setting reduce risk when using multiple DCA orders?
- Is this feature suitable for both beginners and advanced traders?
- What does auto_calculate_initial_amount do?