Pierre Rougier: The OnDeinit () method for an indicator, no longer exists in MQL5?
Where do you get that idea? Perhaps you should read the manual.Type | Function name | Parameters | Application | Comment |
int | OnInit | none | Expert Advisors and indicators | Init event handler. It allows to use the void return type. |
void | OnDeinit | const int reason | Expert Advisors and indicators | Deinit event handler. |
: | : | : | : | : |
Pierre Rougier:
Hello,
The OnDeinit () method for an indicator, no longer exists in MQL5?
Did you build this code from the wizard? If so, you may need to add it yourself.
OnDeinit() works for both Experts and Indicators.
void OnDeinit(const int reason) { Print(StringFormat("%s(): reason [%d]", __FUNCTION__, reason)); }
Did you build this code from the wizard?
Exactly.
Thanks,
Pierre
Anthony Garot #:
Did you build this code from the wizard? If so, you may need to add it yourself.
OnDeinit() works for both Experts and Indicators.
Is it useful to delete an handle in a indicator when we closing it? I do this in expert advisor writing
//+------------------------------------------------------------------+ //| [FUNCTION] Deinitialization | //+------------------------------------------------------------------+ void OnDeinit(const int reason) { if(GIO != INVALID_HANDLE) IndicatorRelease(GIO); }

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,
The OnDeinit () method for an indicator, no longer exists in MQL5?