Skip to content

Common Mistakes

Even experienced traders can run into issues when writing automated bots. Here are some common mistakes to watch out for:

Running untested scripts live can lead to unexpected losses.
Always validate in simulation mode before enabling live trading.


Small frequent trades can quickly be eaten up by fees.
✅ Factor in trader.exchangeFee and avoid over-trading.


Building a strategy that works only on past data often fails live.
✅ Use realistic conditions and forward-test in simulation.


Starting with big positions without proof of performance is risky.
✅ Begin with minimal amounts and scale gradually.


Sometimes indicators or candles can return null (e.g., new markets).
✅ Check values before using them in logic:

if (candle.close !== null) { /* ... */ }

Even automated bots require oversight. ✅ Check logs regularly and be ready to pause if something is off.


Combining too many indicators or complex logic can lead to confusion and poor results. ✅ Start simple and iterate step by step.


Failing to limit losses can wipe out gains. ✅ Include safety mechanisms like:

  • Position sizing limits
  • Stop-loss conditions
  • Manual abort via trader.abort()

9. Forgetting to Handle Network or Exchange Issues

Section titled “9. Forgetting to Handle Network or Exchange Issues”

APIs can fail, data may lag, or markets can behave unexpectedly.

✅ Design scripts to fail safely and avoid placing unintended orders.


10. Leaving Bots Unattended for Long Periods

Section titled “10. Leaving Bots Unattended for Long Periods”

Markets change rapidly.
✅ Review performance regularly and adjust strategies if conditions shift.


By avoiding these mistakes and following the best practices, you’ll significantly increase your chances of running safe and effective trading bots.