Advertisement IC Markets

Logging every order decision inside an EA

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

Logging every order decision inside an EA

Post by FXS London Scalper »

An expert advisor that only logs filled trades makes debugging hard. When it fails to open a trade, nobody knows why. A better habit is to log every decision point: signal checked, conditions met or not, order sent, broker response.

A practical structure is one log line per bar with key values: indicator readings, spread at the time, whether filters passed, and the final action. Writing to a CSV file makes it easy to analyse later in a spreadsheet.

A worked example: an EA that should trade a breakout misses several signals. The log reveals that spread exceeded the maximum allowed at those moments. Without the log, the cause would be guesswork.

Logging adds some overhead, so on very fast strategies it may be worth logging only on signal bars. File size should also be managed, for example by starting a new file each day.

When sharing logs on the forum for help, remove account numbers and any personal information.

What do you include in your EA logs?
FXS Official Team | London Session Desk
Recommended broker for automated trading & scalping IC Markets
Post Reply