Enabling Smart TP (Smart Take Profit) in MagicTradeBot allows the bot to dynamically trail profits instead of using a fixed profit target, maximizing gains while protecting your position.
🧠 Steps to Enable Smart TP
Locate the TakeProfitRules Section
- Open your
decision_engine.yamlfile - Find the
TakeProfitRulesconfiguration block
- Open your
Enable Smart TP for a Rule
- Set the
EnableSmartTPflag totruefor the specific rule you want to activate
- Set the
TakeProfitRules:
- TargetProfitPer: 6
SellPer: 40
RuleName: "Target - Short"
IsEnabled: true
EnableSmartTP: true # Enable Smart TP for this rule
TrailingGapPer: 2 # Optional: Pullback percentage to trigger sell
MinProfitLock: 4 # Optional: Minimum guaranteed profit
UseDynamicGap: true # Optional: Adjust trailing gap dynamically
- Optional Parameters to Enhance Smart TP
| Parameter | Purpose |
|---|---|
TrailingGapPer |
Determines how much the price can pull back from its peak before executing the TP. |
MinProfitLock |
Guarantees a minimum profit is secured before the bot closes the trade. |
UseDynamicGap |
Automatically adjusts the trailing gap based on market volatility. |
Partial vs Full TP
- You can combine Smart TP with partial sell rules (
SellPer < 100) to lock profits incrementally - Multiple rules can be configured to stagger profit-taking dynamically
- You can combine Smart TP with partial sell rules (
🔄 How It Works
- When the trade reaches the TargetProfitPer, Smart TP monitors the peak price
- If price reverses by
TrailingGapPer, the bot closes the portion of the position specified bySellPer - Ensures profit is captured dynamically, unlike fixed TP which closes at a predetermined percentage
📌 Key Points
- Enable per rule: Smart TP is rule-specific, not global
- Works with long and short trades independently
- Fully compatible with partial TP rules and DCA orders
- Recommended for volatile markets to maximize profit while minimizing risk