How does DCA affect maximum trade duration?

In MagicTradeBot, Dollar-Cost Averaging (DCA) can influence the total duration a trade remains open. When multiple DCA orders are triggered, each additional order can extend the trade’s Maximum Hold Time if configured to do so.


🧠 How It Works

  1. Maximum Hold Time Base

    • Each trade has a MaximumHoldTime defined:

      MaximumBuyHoldTime: 380   # for long trades
      MaximumSellHoldTime: 380  # for short trades
      
    • This is the base duration a trade can remain open without intervention.
  2. DCA Extension Setting

    • DCA orders can increase the hold time using:

      AdditionalTimePerDCAOrderPercentage: 0.8
      
    • Explanation: For each DCA order executed:

      • 80% of the original Maximum Hold Time is added to the trade’s remaining duration
      • This ensures the trade has enough time to reach profit targets as additional DCA positions are opened
  3. Example Calculation

    Suppose:

    • MaximumBuyHoldTime = 380 minutes
    • AdditionalTimePerDCAOrderPercentage = 0.8 (80%)

    If 2 DCA orders are triggered:

    • First DCA → Add 380 × 0.8 = 304 minutes
    • Second DCA → Add another 380 × 0.8 = 304 minutes
    • Total potential hold time = 380 + 304 + 304 = 988 minutes (~16.5 hours)

    This allows trades to stay open longer when the bot continues averaging down or up to improve trade outcome.


🔄 Interaction with Smart TP

  • If Smart TP Lock is enabled and profit is secured:

    • The extended hold time from DCA is ignored
    • Trade may still close sooner to lock profits
  • If Smart TP is not active:

    • Maximum Hold Time including DCA extensions determines exact trade duration

📌 Why This Feature Matters

  • Provides flexibility for DCA strategies in volatile markets
  • Prevents trades from closing prematurely while additional positions are being added
  • Ensures trades have enough time to reach profit targets even as average entry price changes
  • Helps balance risk and reward in multi-step DCA strategies

🎯 Key Takeaways

  • Maximum trade duration can increase dynamically with each DCA order
  • Controlled via AdditionalTimePerDCAOrderPercentage
  • Works together with MaximumHoldTime and Smart TP rules
  • Ensures DCA trades are given sufficient time to succeed without leaving capital exposed unnecessarily

📎 Related Topics