ExpertRemove(); if (!IsStopped()) Comment("Hi Hossein");
Hi,
in the MQL-Reference you can read this:
The Expert Advisor is not stopped immediately as you call ExpertRemove(); just a flag to stop the EA operation is set.That is, any next event won't be processed, OnDeinit() will be called and the Expert Advisor will be unloaded and removed
from the chart.
I think, this answers your question.
Best regards
Please learn to read the documentation. It will only be removed once your return from the current event handler.
"The Expert Advisor is not stopped immediately as you call ExpertRemove(); just a flag to stop the EA operation is set. That is, any next event won't be processed, OnDeinit() will be called and the Expert Advisor will be unloaded and removed from the chart."
Also, please don't use the old almost obsolete MQL4 code. Us the new modern MQL4+ event handlers such as OnInit(), OnTick() and OnDeinit().
- docs.mql4.com
Hi,
in the MQL-Reference you can read this:
The Expert Advisor is not stopped immediately as you call ExpertRemove(); just a flag to stop the EA operation is set.That is, any next event won't be processed, OnDeinit() will be called and the Expert Advisor will be unloaded and removed
from the chart.
I think, this answers your question.
Best regards
It says "any next event won't be processed" but my Comment processed after it!
"Event" is not the same as function. "Events" are things like a new tick for OnTick() or a time event for OnTimer().
Hi,
of course, "any next event won't be processed" means, that no further events will be processed.
But the Comment is a statement in the same event.
Hope this helps you.
Best regards
... I see Fernando has explained it while i was typing :-)
Yes! It will only be removed once your return from the current event handler.
Thank you all guys.
Greatly appreciated!
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
Hi guys,
I'm confused why this happens?
By this code I receive the comment "Hi Hossein", however it is after ExpertRemove()!
Why my code even work after ExpertRemove function?
please note there is no code in deinit function.
Any advice is appreciated.