Please edit your post and use the code button (Alt+S) when posting code.
Check the Experts tab. You possibly have a critical error in the EA and the EA is stopped without OnDeinit being called.
Nothing wrong with your deinit except it can be simplified.
void OnDeinit(const int reason){ ObjectsDeleteAll(0, ObjPrefix); Comment(""); }
![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
Hello MQ4 community, I am having a weird situation. I have EA that has OnDeinit function, that works sometimes but other times it does not. Is there like a "session save" type of situation here ? I mean code I have is pretty straightforward as below:
Simply, I would like to open a fresh chart without any objects on it, is there a better way ?
thanks in advance, cheers.