HosseinKOGO:
Hi friends,
I've noticed when I use GVs in my code, They does save when I do backtest. How can I prevent saving and also retrieving GVs during backtest while they are permitted to save and retrieve in Live trading? Any idea?
check what mode it is running and and control from there
https://docs.mql4.com/check/istesting
https://docs.mql4.com/check/isvisualmode
https://docs.mql4.com/check/isoptimization
but if you require GVs but ignore them in testing will the testing results be valid...
![IsTesting - Checkup - MQL4 Reference IsTesting - Checkup - MQL4 Reference](https://c.mql5.com/36/51/istesting-checkup-mql4-reference.png)
- 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.05.15)
![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
Hi friends,
I've noticed when I use GVs in my code, They does save when I do backtest. How can I prevent saving and also retrieving GVs during backtest while they are permitted to save and retrieve in Live trading? Any idea?