Saving indicator values at entry so you can analyse trades later
Posted: Sat Oct 17, 2026 7:01 pm
Saving indicator values at entry so you can analyse trades later
When an EA opens a trade, it usually logs the time, price, size and maybe the reason. What it often doesn't log is the state of the market at that moment: the indicator values, the spread, the ATR, the distance to the nearest level.
Saving those values with each trade makes later analysis much easier. You can look at whether trades with a higher ATR at entry did better or worse, whether the RSI value at entry made a difference, or whether trades entered with a wider spread performed worse.
Without that data, you'd have to recalculate it from historical prices, which is possible but tedious, and the values might differ slightly from what the EA saw live.
What I'd log: the values of every indicator the strategy uses, plus a few that it doesn't use but might be interesting, like ATR on a couple of timeframes, the spread, the time since the session opened, and the distance from the daily open. All written to a CSV row with the trade ID.
Then, after a few hundred trades, you can load the file into a spreadsheet or Python and look for patterns. This is how a lot of useful filters get discovered, from data rather than guesses.
The cost is a few lines of code and a slightly bigger log file.
When an EA opens a trade, it usually logs the time, price, size and maybe the reason. What it often doesn't log is the state of the market at that moment: the indicator values, the spread, the ATR, the distance to the nearest level.
Saving those values with each trade makes later analysis much easier. You can look at whether trades with a higher ATR at entry did better or worse, whether the RSI value at entry made a difference, or whether trades entered with a wider spread performed worse.
Without that data, you'd have to recalculate it from historical prices, which is possible but tedious, and the values might differ slightly from what the EA saw live.
What I'd log: the values of every indicator the strategy uses, plus a few that it doesn't use but might be interesting, like ATR on a couple of timeframes, the spread, the time since the session opened, and the distance from the daily open. All written to a CSV row with the trade ID.
Then, after a few hundred trades, you can load the file into a spreadsheet or Python and look for patterns. This is how a lot of useful filters get discovered, from data rather than guesses.
The cost is a few lines of code and a slightly bigger log file.