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,
TrailingGapPeris 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
Trade moves in favor:
- Price rises steadily → bot tracks the peak
Gap adjustment:
- As profit increases beyond initial expectations, the trailing gap widens proportionally
- Prevents premature closure from minor pullbacks
Profit lock:
- Minimum profit (
MinProfitLock) is always honored - Trailing execution occurs only after gap and minimum profit conditions are satisfied
- Minimum profit (
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 percentageMinProfitLock→ 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.