if(IsStopped()){ ExpertRemove(); }
Maybe you misunderstood, I know that deinitialization occurs in in OnDeInit(). However, I see no evidence of it being called when I click stop in the visualization mode. See the following photo for the print in the journal for the sample program above when you close the visualization part-way through the backtest:
If it was a normal closure, I should see a lot of things printed.
Maybe you misunderstood, I know that deinitialization occurs in in OnDeInit(). However, I see no evidence of it being called when I click stop in the visualization mode. See the following photo for the print in the journal for the sample program above when you close the visualization part-way through the backtest:
If it was a normal closure, I should see a lot of things printed.
MQ deliberately decided to not call this event handler OnDeinit() in the visual tester.
Their reasoning is not intuitive for me, but they do what they want. We can only accept it.
MQ deliberately decided to not call this event handler OnDeinit() in the visual tester.
Their reasoning is not intuitive for me, but they do what they want. We can only accept it.
Thanks for this information. Also, do you know if this also means that all destructors are not called as well?

- 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 am trying to debug my deinitialization with the visualizer, but I don't see any evidence of deinitialization in the visualizer's Journal. Is there a way to get normal deinitialization in the Visualizer Tool?
Here is the basic EA I wrote to check to see if I could get any reactionary print in the journal:
Order of Testing:
1. At first I had the DeInit print and got nothing
2. Then I tried seeing if opening a trade would trigger something and got nothing still printed
3. Then I tried to inserting an error in deinitialization and no error was raised.
4. Finally I tried to see if IsStopped would do anything to catch the shutdown then call ExpertRemove() (as this gives me the expected reaction in the journal). However, IsStopped doesn't catch the Visualizer shutdown (maybe something else does?)
Thanks in Advanced