Dynamic Stop-Loss (Dynamic SL) in MagicTradeBot is an advanced risk management feature that works similarly to Smart Take Profit, but for protecting against losses. Instead of a fixed stop-loss, it adjusts automatically based on the tradeโs movement, allowing the bot to lock in profits or minimize losses dynamically.
๐ง How Dynamic Stop-Loss Works
Percentage-Based Adjustment
- The bot tracks the maximum favorable movement of a trade
- The stop-loss is set as a percentage of this peak rather than the original entry price
Example:
- Entry price: $100
- Maximum price reached: $120
- DynamicSLPercentage: 5% โ stop-loss moves up to $114 (5% below peak)
Reactive to Market Movements
- If the market continues in your favor, the stop-loss trails upwards for long trades or downwards for short trades
- If the market reverses, the stop-loss executes automatically, protecting profits or reducing losses
Integration with Threshold Rules
- Dynamic SL can be enabled per Threshold Rule (
EnableDynamicSL: true) - Works together with
CloseIfProfitandCloseIfLossconditions
- Dynamic SL can be enabled per Threshold Rule (
๐ Example Configuration
ThresholdRules:
- Minutes: 10
ThresholdPer: -5
RuleName: "Dynamic SL - Long"
EnableDynamicSL: true
DynamicSLPercentage: 3
CloseIfProfit: false
CloseIfLoss: true
Scenario:
- Trade opens at $100
- Price rises to $110 โ Dynamic SL moves to $106.7 (3% below peak)
- Price drops to $106.7 โ trade closes automatically, securing profit
๐ When to Use Dynamic Stop-Loss
- Trending Markets: Locks in profits as price moves strongly in your favor
- Volatile Markets: Avoids premature closure during small retracements
- DCA Trades: Protects averaged positions by adapting stop-loss to each entry
- High-Leverage Trades: Reduces risk of sudden liquidation due to market swings
โ Key Advantages
- Adapts stop-loss to real-time market conditions
- Protects profits while still giving trades room to grow
- Reduces emotional/manual monitoring of positions
- Complements Smart TP for fully dynamic trade management
In short, Dynamic Stop-Loss makes your bot behave like a professional trader, adjusting exit points in real time based on market movement and maximizing profit protection.