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
![MQL5 - Language of trade strategies built-in the MetaTrader 5 client terminal](https://c.mql5.com/i/registerlandings/logo-2.png)
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
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?