MQL4/MT4. What is the difference between clicking mt4.exe vs loading the saved Template?

 

I have an error in values in one of my downloaded and modified Pivot point indicator.

When I load the template, all values are correct. But when I clicked my MT4.exe to run the program, sometimes

the values are wrong. I need to load my saved template to make it correct. Any one experience this? Thank you.

I am checking it currently do i have to do something in the init() and deinit()?

All values comes from this.

 high  = iHigh(NULL,TimePeriod,shft);
 low   = iLow(NULL,TimePeriod,shft);
 open  = iOpen(NULL,TimePeriod,shft);

 
high  = iHigh(NULL,TimePeriod,shft);
 low   = iLow(NULL,TimePeriod,shft);
 open  = iOpen(NULL,TimePeriod,shft);

On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
          Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)

Not in OnInit, in OnCalculate.
 
William Roeder #:

On MT4: Unless the current chart is that specific symbol(s)/TF(s) referenced, you must handle 4066/4073 errors before accessing candle/indicator values.
          Download history in MQL4 EA - MQL4 programming forum - Page 3 #26.4 (2019)

Not in OnInit, in OnCalculate.
So precise! I'll use and test it for a week.