Hello
In "OnInit ()" I house the static part of the display of an EA to avoid refreshing it with each tick. To accelerate the optimization I use "IsOptimization ()" to display nothing.
I do not notice any difference of time between with and without. Is OnInit () executed at each optimization cycle or only once at the beginning of the process?
Thank
- Errors, bugs, questions
- Why would this work on the chart window and not on separate window?
- which is the difference between IsTesting( ) or IsOptimization( ) function?
stanislass: In "OnInit ()" I house the static part of the display of an EA to avoid refreshing it with each tick. To accelerate the optimization I use "IsOptimization ()" to display nothing.
OnInit() is run on every Optimisation pass/run, but during Optimisation, MetaTrader already disables all Chart and Display events, so you will not see much improvement in speed compared to disabling it yourself (unless you have heavy calculations associated with the updating of visual elements).I do not notice any difference of time between with and without. Is OnInit () executed at each optimization cycle or only once at the beginning of the process?
If it is still too slow for you, then maybe consider refactoring your code and only executing code section only when necessary, such as only on new bar events or only when price changes more than a certain amount, instead of on every tick.
Okay, I understand better. Thank you for your clarification.

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