Hello everyone,
I'm still a bit of a beginner in the world of MQL5.
I have an mt5 desktop with two accounts set up (one for each forex pair I want to trade).
I've coded an expert advisor to execute my trades more easily. When I change the symbol or timframe, everything works perfectly as long as I stay in the same account : call of the void OnDeinit(const int reason) followed by the OnInit() function.
However, when I change account, I notice that only the OnDeinit(const int reason) function is called. The EA appears in the Expert List, but the OnInit() function is not called. So my panel and other objects aren't displayed on the graph (they are deleted by the OnDeinit() function).
Is there any way of dealing with this? Or do I have to manually reset the EA on the chart each time I change account?
Thanks in advance for your help !
The code used in the functions :
Can't be reproduced. Tested on build 3802 and 3930.
Show your log.
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hello everyone,
I'm still a bit of a beginner in the world of MQL5.
I have an mt5 desktop with two accounts set up (one for each forex pair I want to trade).
I've coded an expert advisor to execute my trades more easily. When I change the symbol or timframe, everything works perfectly as long as I stay in the same account : call of the void OnDeinit(const int reason) followed by the OnInit() function.
However, when I change account, I notice that only the OnDeinit(const int reason) function is called. The EA appears in the Expert List, but the OnInit() function is not called. So my panel and other objects aren't displayed on the graph (they are deleted by the OnDeinit() function).
Is there any way of dealing with this? Or do I have to manually reset the EA on the chart each time I change account?
Thanks in advance for your help !
The code used in the functions :