How to clear chart (from objects) after switching to different TIMEFRAME chart?

To add comments, please log in or register
selnomeria
231
selnomeria  

I code indicator which plotes trendlines...

However, after switching to different timeframe chart, the previously ploted objects are still there, on new Timeframe chart...

How to delete those previous Timeframe's chart's objects automatically?

Taras Slobodyanik
28896
Taras Slobodyanik  
//+------------------------------------------------------------------+
//| Deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)
  {
   DelObjects();
  }

void DelObjects()
{
ObjectsDeleteAll(0,Label_prefix,-1,-1); //Label_prefix - the prefix of your objects
ChartRedraw(0);
}
selnomeria
231
selnomeria  
Taras Slobodyanik:

thanks!!!!!
To add comments, please log in or register