A static is initialized before OnCalculate() is call and before OnInit(), so the "global initialization". You can't be sure Time[] is already set.

You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
I started a test in visual mode and a template with the same name of the EA is set on the chart.
Then I get this message
2017.01.28 02:31:27.176 VPC EURUSD,H1: array out of range in 'VPC.mq4' (121,33)
2017.01.28 02:31:27.176 VPC EURUSD,H1: global initialization failed
followed by a similar report for another indicator.
So I checked the indicators code and it is this
in both indicators.
That seems really weird to me as it is executed in OnCalculate(), surely Time[0] should already be loaded in the tester?
The EA still calls the indicators correctly, but they are not displayed.
Odd thing is that changing the code to this
static datetime bar_time=0;
if(prev_calculated==0)
bar_time=Time[0];