Simple script (not EA) asks for confirmation "Do you really want to stop script...?"

 

Hi all,

Here is a script:


void OnStart()
  {

  ChartSetSymbolPeriod(0, Symbol(), PERIOD_M5);
   
  }

It suppose to set TF on current chart to M5. When I try to run a script it shows a pop-up "Do you really want to stop script...?"

If I click No, script does not work, if I click Yes, script works and sets the needed timeframe.

I need it to run seamlessly, is it possible? 

I have a dozen of other scripts, all work fine.

Thank you.


Edit: it is MT4

 
Post the entire code.
 
Fabio Cavalloni #:
Post the entire code.
#property copyright ""
#property link      ""
#property version   "1.00"
#property strict

//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {

  ChartSetSymbolPeriod(0, Symbol(), PERIOD_M5);
   
  }