Graphical objects do not work during optimisations.
Instead, write your code not to depend on graphical objects for data. Use variables (they are way faster).
Only use graphical objects for display purposes if really needed. Have an option to enable them or not for the user, but don't depend on them for the logic execution.
Operation of Programs in the Strategy Tester - MQL4 programs - MQL4 Reference
Graphical Objects in Testing
During visualization, the Expert Advisor interacts with a real chart. In case there is no visualization, the Expert Advisor works with a "virtual" chart that is not displayed. The former case has some peculiarities. During optimization, working with graphical objects is not supported.
- docs.mql4.com
Operation of Programs in the Strategy Tester - MQL4 programs - MQL4 Reference
Graphical Objects in Testing
During visualization, the Expert Advisor interacts with a real chart. In case there is no visualization, the Expert Advisor works with a "virtual" chart that is not displayed. The former case has some peculiarities. During optimization, working with graphical objects is not supported.
got it, thank you very much:)
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
see code example and pic attached.