How to reset an Indicator 'iCustom' in an EA

 

This is what I'm doing

int OnInit()

  {     

COG_handle=iCustom(NULL,0,indicatorName,bars_back,mm,ii,kstd,kstdinternal,sName);

 ...}

Now every time I change somethign while the EA runs (Time frames etc..) it loads a new handler.

how can I stop the indicator from running and reloadit in order to have only one copy of it running?

 
IndicatorRelease()
 
Keith Watford:
IndicatorRelease()

ok Thanks

 
kostasAnt:

COG_handle=iCustom(NULL,0,indicatorName,bars_back,mm,ii,kstd,kstdinternal,sName);

Now every time I change somethign while the EA runs (Time frames etc..) it loads a new handler.

how can I stop the indicator from running and reloadit in order to have only one copy of it running?

You are reading the indicator off the current chart. So of course you load a new handle when you change charts. There is only one copy running. The previous one was stopped when you changed timeframes. There is nothing to do.