Hi,
Let's say, I'm running an indicator on a chart and I want to program it once the indicator is unloaded / closed manually or automatically, it will automatically initiate a preferred template at \templates\***.tpl.
I tried to use only the ChartApplyTemplate(0,default.tpl) in the OnDeinit(const int reason) block, if I do not modify, change any input variables and compile the indicator, it can work well accordingly. However if I modify, change any input variables and compile the indicator, the MT4 will get hang and shut down.
Can anyone advise any codes that I can modify, change any input variables and compile the indicator and yet will not face any MT4 gets hang and shut down. Furthermore, once the indicator is closed, the current chart will automatically load a preferred template at \templates\***.tpl.
Remarks : I don't know whether this ChartIndicatorDelete can be used for the above purposes, but from my understanding, it is used to close other indicator but not closing indicator itself.
Please help, thanks.
Let's say, I'm running an indicator on a chart and I want to program it once the indicator is unloaded / closed manually or automatically, it will automatically initiate a preferred template at \templates\***.tpl.
I tried to use only the ChartApplyTemplate(0,default.tpl) in the OnDeinit(const int reason) block, if I do not modify, change any input variables and compile the indicator, it can work well accordingly. However if I modify, change any input variables and compile the indicator, the MT4 will get hang and shut down.
Can anyone advise any codes that I can modify, change any input variables and compile the indicator and yet will not face any MT4 gets hang and shut down. Furthermore, once the indicator is closed, the current chart will automatically load a preferred template at \templates\***.tpl.
Remarks : I don't know whether this ChartIndicatorDelete can be used for the above purposes, but from my understanding, it is used to close other indicator but not closing indicator itself.
Please help, thanks.