Testing & evaluation
Look-ahead bias in EA testing: avoid using tomorrow’s information
A historical calculation can accidentally use information that was not available at the moment of a decision. The resulting chart may look convincing because the code is effectively seeing part of the future.
Attach a time to every feature
For each entry, identify which candle or event supplied the value and whether it had completed. A higher-timeframe candle may still be forming even though many lower-timeframe candles have already closed.
Inspect alignment boundaries
Check session changes, higher-timeframe boundaries and imported datasets. Avoid assigning a completed daily value to every minute earlier in that same day. Keep feature time and decision time in your diagnostic output.
Use a walk-through example
Pick one trade and reconstruct exactly what information the EA could access at that instant. Compare this with the values your analysis used after the period finished. This often reveals an alignment problem quickly.
Make the rule auditable
Readable source and explicit timestamps turn an impressive curve into an explainable process. Fixing a timing error may change the result substantially, but it gives you a much more useful foundation for future development.
Start with a free editable EA project · Explore MQLume source code
Back to top