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

 

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?

 
//+------------------------------------------------------------------+
//| 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);
}
 
Taras Slobodyanik:

thanks!!!!!
Reason: