What is automatic DCA position size calculation in MagicTradeBot?

  • Home
  • Documentation
  • What is automatic DCA position size calculation in MagicTradeBot?

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

  1. Evaluate Account Balance

    • MagicTradeBot checks your available balance in live mode
    • For demo/testing, you can also set a fixed balance value
  2. Apply Total Investment Percentage

    • total_percent_investment_per_trade defines 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
  3. Determine Initial Order Size

    • If auto_calculate_initial_amount is enabled:

      • Bot automatically calculates initial order size as a fraction of total DCA exposure
      • If disabled, it uses the InitialAmount specified in trading.yaml
  4. 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
  5. 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

  1. Risk Control

    • Automatically keeps total exposure within defined percentage of account balance
  2. Ease of Use

    • No need to manually calculate order sizes for multiple DCA orders
  3. Consistency

    • Ensures DCA scaling is consistent across trades and symbols
  4. 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_orders
    • size_multiplier
    • total_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