Hi everyone!
In the strategy I'm developing now the orders should be sent in the defined time interval between 21 and 23 +0000 UTC.
As I understand, the bars on charts are shown in +0000 UTC, but the as the result of function call
tick.getTime()
I get time in my current timezone (UTC +3). So to get hour is UTC, I use the following code:
Calendar cal = Calendar.getInstance();
TimeZone current_tz = cal.getTimeZone();
Date date = cal.getTime();
long UTCOffset=current_tz.getOffset(date.getTime());//get local computer timezone shift
Time = curTick.getTime()-UTCOffset;//tick time in +0000 UTC
calendar.setTimeInMillis(Time);
EA_GMTTime = calendar.get(Calendar.HOUR_OF_DAY); //get current hour in +0000 UTC
Can you please check, if this code is correct, and will it work correct on strategy backtesting?
Also I would like to know, in what time zone (local or UTC )order opening and closing time are shown in the html report, that appears after the backtesting is done?