I need help with a code

 
//+------------------------------------------------------------------+
//|                                                       Cambio.mq4 |
//|                                 Desarrollado por William Miranda |
//|                                            Telegram:@wmirandamor |
//+------------------------------------------------------------------+
#property copyright "Desarrollado por William Miranda"
#property link      "Telegram:@wmirandamor"
#property version   "1.00"
#property strict
int TF;
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
    TF = Period();
    if(toOne()==true)
      {
        toCBack();        
      }
       
     
  }
//+------------------------------------------------------------------+

bool toOne()
{
   if(TF!=1)
     {
       ChartSetSymbolPeriod(0, "EURUSD", 1);
       return(true);   
     }
   else return(false);    
   
}

void toCBack()
{
  ChartSetSymbolPeriod(0, "EURUSD", TF);  
}
I need a code that changes the time frame from 15 minutes to 1 minute. Then return it to 15. In order for it to refresh the indicator. My code change to M1 but dont return to M15
 
wmirandamor:
I need a code that changes the time frame from 15 minutes to 1 minute. Then return it to 15. In order for it to refresh the indicator. My code change to M1 but dont return to M15
Don’t do that.  Fix your indicator code instead it will update each tick no need to switch timeframe to force an update.