How do I enable Smart TP rules?

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

  1. Locate the TakeProfitRules Section

    • Open your decision_engine.yaml file
    • Find the TakeProfitRules configuration block
  2. Enable Smart TP for a Rule

    • Set the EnableSmartTP flag to true for the specific rule you want to activate
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
  1. 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.
  1. 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

๐Ÿ”„ 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 by SellPer
  • 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

๐Ÿ“Ž Related Topics