When configuring decision templates in MagicTradeBot, even small misconfigurations can lead to unintended trade behavior or missed exits. Here are the most common mistakes to watch out for:
1️⃣ Missing Negative Sign in Threshold Rules
- Problem: Threshold values in stop-loss rules must correctly indicate loss percentages.
- Example Mistake:
ThresholdPer: 20 # ❌ Missing minus, interpreted as profit
- Correct Usage:
ThresholdPer: -20 # ✅ Indicates 20% loss
- Impact: If the minus sign is missing, the stop-loss will not trigger as expected, putting your balance at risk.
2️⃣ Incorrect ThresholdPer When Using CloseIfProfit / CloseIfLoss
- Problem: If you want a rule to close a trade based on profit or loss after a certain time,
ThresholdPermust be set to0.0. - Example Mistake:
ThresholdRules:
- Minutes: 60
ThresholdPer: -10 # ❌ Will not trigger CloseIfProfit
CloseIfProfit: true
- Correct Usage:
ThresholdRules:
- Minutes: 60
ThresholdPer: 0.0 # ✅ Required for CloseIfProfit/CloseIfLoss
CloseIfProfit: true
CloseIfLoss: false
- Impact: If
ThresholdPeris not0.0, the trade may not close even if the time condition is met.
3️⃣ Ignoring Rule Priority
- Multiple rules in a template are evaluated in order of Minutes or TargetProfitPer.
- Misordering rules can cause premature exits or skipped take-profits.
- Best Practice: Always order threshold rules by Minutes ascending and take-profit rules by
TargetProfitPerascending.
4️⃣ Overlapping or Conflicting Rules
- Avoid conflicting rules, e.g., one rule trying to close a trade at 10% profit and another at 5% with partial sell.
- Conflicts can cause unintended closures or partial sales.
5️⃣ Forgetting to Test in Demo Mode
- Even a syntactically correct template may behave unexpectedly under real market conditions.
- Always run new or updated templates in demo mode for at least 1 week.
✅ Summary of Best Practices
- Always include
-for loss thresholds. - Use
ThresholdPer: 0.0whenCloseIfProfitorCloseIfLossis enabled. - Order rules logically by time and profit targets.
- Avoid conflicting or overlapping rules.
- Test all changes in demo mode before going live.
Following these guidelines ensures your decision templates behave reliably and safely in all market conditions.