How does UseDynamicGap automatically adjust trailing profit?

The UseDynamicGap setting in MagicTradeBot enhances Smart TP (Smart Take Profit) by making the trailing gap adaptive instead of fixed. This allows the bot to capture more profit during strong trending movements while avoiding premature closures.


๐Ÿง  What UseDynamicGap Does

  • Normally, TrailingGapPer is a fixed percentage, e.g., 3% pullback triggers a take profit
  • When UseDynamicGap: true, the bot dynamically increases the trailing gap as the trade moves further in your favor
  • This allows the trade to stay open longer in a strong trend, maximizing gains

Example:

EnableSmartTP: true
TrailingGapPer: 3
MinProfitLock: 4
UseDynamicGap: true

๐Ÿ”„ How It Works in Practice

  1. Trade moves in favor:

    • Price rises steadily โ†’ bot tracks the peak
  2. Gap adjustment:

    • As profit increases beyond initial expectations, the trailing gap widens proportionally
    • Prevents premature closure from minor pullbacks
  3. Profit lock:

    • Minimum profit (MinProfitLock) is always honored
    • Trailing execution occurs only after gap and minimum profit conditions are satisfied

Scenario:

  • Entry price: $100
  • TrailingGapPer: 3%
  • UseDynamicGap: true
Peak Price Adjusted Gap Trigger Price
$103 3% $100.91
$110 4% $105.60
$120 5% $114.00
  • As the trade moves further, the gap increases, allowing more room for the market to fluctuate without closing the trade prematurely

๐Ÿ“Œ Key Points

  • UseDynamicGap = true โ†’ trailing gap is adaptive
  • Maximizes profits in trending markets
  • Works in conjunction with:

    • TrailingGapPer โ†’ base pullback percentage
    • MinProfitLock โ†’ guaranteed minimum profit
    • Partial TP (SellPer) โ†’ gradual scaling out

In short, UseDynamicGap makes Smart TP smarter, letting your trade ride longer in strong trends while still protecting gains from reversals.

๐Ÿ“Ž Related Topics