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
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.
DCA Extension Setting
DCA orders can increase the hold time using:
AdditionalTimePerDCAOrderPercentage: 0.8Explanation: 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
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