Advertisement IC Markets

Common early mistakes when building EAs

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
FXS London Scalper
Posts: 806
Joined: Sun Oct 18, 2026 12:25 pm

Common early mistakes when building EAs

Post by FXS London Scalper »

A list of mistakes that new EA builders often make, collected from threads here and elsewhere. Maybe useful for someone starting.
  • Testing only in "every tick" mode on generated data. Use real ticks where the broker provides them.
  • Ignoring commission in the tester.
  • Hard-coding pip size, which breaks on 3-digit yen pairs and metals.
  • Not checking order return codes, so failed orders go unnoticed.
  • Optimising many parameters on a short period, then being surprised when it fails.
  • No logging, so a bad live trade can't be explained afterwards.
  • Using local time instead of server time, or forgetting daylight saving changes.
A good warm-up exercise: write an EA that does nothing but place and manage one trade with full logging and error handling. Run it on demo for a week. It's boring, but it builds the scaffolding everything else needs.

Another: rewrite the same simple strategy twice, once quickly and once carefully, and compare the logs.

What mistakes would you add?
FXS Official Team | London Session Desk
Recommended broker for automated trading & scalping IC Markets
Amanhasnoname
Posts: 1506
Joined: Fri Oct 30, 2026 9:45 am

Re: Common early mistakes when building EAs

Post by Amanhasnoname »

One I would add is not testing with the spread that the live account actually has. For a long time I backtested with a fixed two pip spread that I had picked at random, and when I switched to the variable spread from my broker's history, a scalping EA that looked profitable lost money in the quiet Asian hours. I now export the real spreads and run the test on those hours separately.

Another one is trusting the optimiser's best result. I once picked the top pass from a few thousand runs and it was a narrow spike in the parameter space, so a small change gave a completely different outcome. These days I look for a plateau where neighbouring values also work and I take the middle of it.

Your warm-up exercise is solid. My own was a single trade EA with a log file, and the thing I found was that my code treated a requote as a success. It is a boring project, but I reuse the scaffolding for everything now.
Post Reply