Detecting back test
jepper: I am writing some files for state persistence, but this is not needed when back testing. What code or environment variable (or similar) can we use in the EA, so it knows when it's being executed by a backtest?
if( MQLInfoInteger( MQL_TESTER ) ) ...
- Documentation on MQL5: Checkup / MQLInfoInteger
- Documentation on MQL5: Constants, Enumerations and Structures / Environment State / Running MQL5 Program Properties
-
ENUM_MQL_INFO_INTEGER
Identifier
Description
Type
MQL_TESTER
Indication that the program is running in the tester
bool
I am writing some files for state persistence, but this is not needed when back testing.
What code or environment variable (or similar) can we use in the EA, so it knows when it's being executed by a backtest?