How to detect Timeframe change/Program close if Indicator Handle is not closed?

 

Hi

It appears that a program's OnInit() and OnDeinit() do not get called if there is an indicator handle opened with ChartIndicatorGet() and not yet released with IndicatorRelease().

My indicators and EAs need to retrieve indicators' buffer data whilst the main indicator/EA is running, hence obtaining the handles once when the program is started seems more efficient.

How can the main indicator/EA detect a timeframe change or program close if OnInit() and OnDeinit() are not called?

My tests have shown that the main indicator program is kept running when a handle is still open, even after the indicator's Chart window is closed.

 
robnorthen:

Hi

It appears that a program's OnInit() and OnDeinit() do not get called if there is an indicator handle opened with ChartIndicatorGet() and not yet released with IndicatorRelease().

My indicators and EAs need to retrieve indicators' buffer data whilst the main indicator/EA is running, hence obtaining the handles once when the program is started seems more efficient.

How can the main indicator/EA detect a timeframe change or program close if OnInit() and OnDeinit() are not called?

My tests have shown that the main indicator program is kept running when a handle is still open, even after the indicator's Chart window is closed.

I have experienced the same problem. Hope some one has a solution.

 
Perhaps this will help a little.
 
fxsaber #:
Perhaps this will help a little.

Thanks. Useful indeed