How can an EA recognize that is opened in test mode?
I want to add a feature for my EA, but I would like this only in test mode.
- Why do you care? Other than diagnostics during non-live/non-optimizer modes, you shouldn't be doing anything different.
- Test for it.
Detect optimization mode programmatically - Expert Advisors - MQL5 programming forum (2020)
William Roeder #:
Let's say I have a test where trades are open, I want this to be automatically on test mode.
- Why do you care? Other than diagnostics during non-live/non-optimizer modes, you shouldn't be doing anything different.
- Test for it.
Detect optimization mode programmatically - Expert Advisors - MQL5 programming forum (2020)
Osmar Sandoval Espinosa #:
Let's say I have a test where trades are open, I want this to be automatically on test mode.
Install a second MT5 for development on a different folder when installing. For example click the installer. exe, at some point it will ask where to install mt5 eg mt5 folder, instead of the one suggested add a 1 and click next. Hope that helps
Let's say I have a test where trades are open, I want this to be automatically on test mode.
Use
MQLInfoInteger (MQL_TESTER)