What I make my EA write to the log, and how it changed how I debug
Posted: Thu Oct 08, 2026 1:43 am
What I make my EA write to the log, and how it changed how I debug
early on my EA logged almost nothing, and when something went wrong I was guessing. Now I log in a structured way, and it's changed how fast I can find problems.
For every signal, it writes the time, the symbol, the values that went into the decision and whether it traded or skipped. For skipped trades, it writes the reason, like spread too high, news filter, outside session, or max trades reached. For orders it logs the requested price, the fill price, the spread at the time and the response from the server.
When I look at a bad trade, I can see exactly what the EA saw and why it acted. The skipped reasons have been useful too, because if one filter is blocking most signals it's clear in the log.
I keep it readable by using a consistent line format. I can export the log and paste it into a spreadsheet to count things like the average slippage per session. It takes a bit of effort to write but pays off the first time something strange happens.
early on my EA logged almost nothing, and when something went wrong I was guessing. Now I log in a structured way, and it's changed how fast I can find problems.
For every signal, it writes the time, the symbol, the values that went into the decision and whether it traded or skipped. For skipped trades, it writes the reason, like spread too high, news filter, outside session, or max trades reached. For orders it logs the requested price, the fill price, the spread at the time and the response from the server.
When I look at a bad trade, I can see exactly what the EA saw and why it acted. The skipped reasons have been useful too, because if one filter is blocking most signals it's clear in the log.
I keep it readable by using a consistent line format. I can export the log and paste it into a spreadsheet to count things like the average slippage per session. It takes a bit of effort to write but pays off the first time something strange happens.