What are common mistakes when configuring decision templates?

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, ThresholdPer must be set to 0.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 ThresholdPer is not 0.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 TargetProfitPer ascending.

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

  1. Always include - for loss thresholds.
  2. Use ThresholdPer: 0.0 when CloseIfProfit or CloseIfLoss is enabled.
  3. Order rules logically by time and profit targets.
  4. Avoid conflicting or overlapping rules.
  5. Test all changes in demo mode before going live.

Following these guidelines ensures your decision templates behave reliably and safely in all market conditions.

📎 Related Topics