Use UninitializeReason function and analyze returned code.
You can call this function in the init. Code 5 means parameters were changed just
now.
stringo:
Thanks for the quick answer.Use UninitializeReason function and analyze returned code.
You can call this function in the init. Code 5 means parameters were changed just
now.
But just to be sure: will the init be called every time the parameters are changed or is it called only when you start the EA?
Every time after parameters were changed and pressed OK button. First deinit with
old parameters then init with new parameters. See https://docs.mql4.com/runtime/start
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 think that if the user changes the input, the EA is not reloaded but just the inputs are reloaded.
Are also the EA's globlal variables reinitialised or is there anything that is run when the inputs are updated by the user such as init() ?
Thanks