What does auto_calculate_initial_amount do?

The auto_calculate_initial_amount setting in MagicTradeBot is part of the automatic DCA position sizing calculation system. Its primary function is to automatically determine the size of the initial order based on your account balance and configured DCA exposure rules, ensuring that your total risk per trade stays controlled.


๐Ÿ”น 1๏ธโƒฃ How It Works

  1. Evaluates Account Balance

    • In live mode, MagicTradeBot checks your real-time available balance
    • In demo mode, you can set a fixed balance value for testing
  2. Applies Total DCA Investment Limit

    • The bot uses total_percent_investment_per_trade to determine the maximum exposure allowed across all DCA orders
    • Example: 2% of a $1,000 account โ†’ total DCA allocation = $20
  3. Calculates Initial Order Size

    • Based on:

      • Maximum number of DCA orders (max_orders)
      • Size multiplier (size_multiplier)
      • Remaining exposure after considering future DCA orders
    • Ensures that initial order + all potential DCA orders stay within the total risk limit
  4. Dynamic Adjustment for Subsequent Orders

    • Once the initial order is placed, subsequent DCA orders are scaled automatically
    • auto_calculate_initial_amount guarantees that scaling starts from a safe, properly sized base order

๐Ÿ”น 2๏ธโƒฃ Practical Example

Account: $1,000 DCA Settings: max_orders: 2, size_multiplier: 1.2, total_percent_investment_per_trade: 3%

Step 1 โ€“ Calculate Total DCA Allocation

  • Total exposure = 3% of $1,000 = $30

Step 2 โ€“ Determine Initial Order Size

  • Initial order = $30 รท (1 + 1.2) โ‰ˆ $13.64

Step 3 โ€“ Determine DCA Order Size

  • DCA 1 = $13.64 ร— 1.2 โ‰ˆ $16.36

Result:

  • Total exposure = $13.64 + $16.36 = $30 โ†’ matches total risk allocation

auto_calculate_initial_amount ensures that the initial order is sized correctly to keep all subsequent DCA orders within your defined limits.


๐Ÿ”น 3๏ธโƒฃ Key Benefits

  • Risk Management: Protects your account by ensuring the initial and subsequent orders never exceed your total allocation
  • Simplicity: Removes the need to manually calculate the starting order
  • Consistency: Ensures DCA grids always start from a properly scaled base, keeping exposure predictable
  • Adaptive: Automatically adjusts the initial order based on account balance and DCA settings

๐Ÿ”น 4๏ธโƒฃ Key Takeaways

  • auto_calculate_initial_amount = true โ†’ initial order is calculated automatically
  • Ensures that total DCA exposure remains within the predefined percentage of your account balance
  • Reduces human error and supports safe, systematic DCA trading
  • Works hand-in-hand with size_multiplier, max_orders, and total_percent_investment_per_trade

In short, this setting is the foundation of safe automatic DCA execution, giving you a properly sized starting order from which all other DCA orders are scaled automatically.

๐Ÿ“Ž Related Topics