Your query does not make sense. If you don't want to loose your EA properties, then save them as a .set file and load them them when you place the EA on the chart.
Also, if you don't want the OnInit() function to "fail", then don't return the value INIT_FAILED. Instead return the value INIT_SUCCEEDED and handle the situation within the EA functionality, by warning the user via an Alert() or printing it to the log file or some other method. Personally I don't think that is a good practice, but that is up to you.
Your query does not make sense. If you don't want to loose your EA properties, then save them as a .set file and load them them when you place the EA on the chart.
Also, if you don't want the OnInit() function to "fail", then don't return the value INIT_FAILED. Instead return the value INIT_SUCCEEDED and handle the situation within the EA functionality, by warning the user via an Alert() or printing it to the log file or some other method. Personally I don't think that is a good practice, but that is up to you.
yes I used this workaround already about INIT_SUCCEEDED on fail.
my question is if the other ways to terminate an EA (I forget the exact function names), will also cause the EA to get removed from the chart - or if it will just stop operation of the EA but keep the settings on the chart intact.
If you are referring to the ExpertRemove() function, then obviously the "expert" will get "removed" from the chart, just as the name of the function states.
Again, I will repeat, that you can save the EA's "inputs" to a set file so they can be loaded again and reused.
If you are referring to the ExpertRemove() function, then obviously the "expert" will get "removed" from the chart, just as the name of the function states.
Again, I will repeat, that you can save the EA's "inputs" to a set file so they can be loaded again and reused.
yes I used this workaround already about INIT_SUCCEEDED on fail.
my question is if the other ways to terminate an EA (I forget the exact function names), will also cause the EA to get removed from the chart - or if it will just stop operation of the EA but keep the settings on the chart intact.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I noticed that in some cases when an EA quits, it will remove your EA and consequently all settings associated with the EA are gone (because the EA is gone)... this is very undesirable behaviour for me.
I think I noticed this when returning a failure code from OnInit()
I want to write some assert function ... (or does anyone know some good assert libraries for MQL4&5 - work with both I mean) ?
I want to quit the EA if the assertion fails but I don't want to lose my EA on the chart.
What command should I use in MQL to do this?