I am bothered about the different time zones,
the opening price and closing price of the K line are different,
because these basic data are not correct, resulting in very different results of the strategy operation I learned from Wikipedia that
all API data is based on the UTC time zone, but the K line displayed by the platform is based on the UTC+2 time zone.
I
would like to ask, how do I obtain the K line data shown in the figure??? 。。。。。。。。。。。。。。。。。。。。。
IBar preDailyBar;
List<IBar> bars;
if(Specperiod.equals(Period.DAILY))
{
long lastTickTime = history.getLastTick(SpecInstru).getTime();
Calendar calendar = Calendar.getInstance();
calendar.setTimeZone(TimeZone.getTimeZone("GMT+2"));
calendar.setTimeInMillis(lastTickTime);
calendar.set(Calendar.HOUR_OF_DAY, baseHour );
calendar.set(Calendar.MINUTE, 0);
calendar.set(Calendar.SECOND, 0);
long endDays = calendar.getTimeInMillis();
long beforeDay= endDays -3*24*60*60*1000;
bars = history.getBars(SpecInstru, Specperiod, OfferSide.ASK, Filter.WEEKENDS, 3, endDays, 0);
}
.................................................................
exception
com.dukascopy.api.JFException: Interval from [2018.05.10 21:00:00 400] to [2018.05.13 21:00:00 400] GMT is not valid for period [Daily]
at com.dukascopy.api.impl.o.b(L:1386)
at com.dukascopy.api.impl.o.getBars(L:2885)
at COM.Mystrategies.TradeTool.CheckThreeUpDown(TradeTool.java:1044)
at COM.Mystrategies.TradeTool.InitActiveInstruIndicator(TradeTool.java:1007)
at COM.Mystrategies.TradeTool.InitAllStatuse(TradeTool.java:436)
at COM.Mystrategies.TradeTool.onStart(TradeTool.java:281)
at com.dukascopy.api.impl.execution.s.call(L:27)
at com.dukascopy.api.impl.execution.s.call(L:13)
at com.dukascopy.api.impl.connect.as.a(L:140)
at com.dukascopy.api.impl.connect.cl.call(L:709)
at com.dukascopy.api.impl.connect.cl.call(L:670)
at com.dukascopy.api.impl.execution.j.call(L:34)
at java.util.concurrent.FutureTask.run(Unknown Source)
at com.dukascopy.api.impl.execution.f$a.e(L:904)
at com.dukascopy.api.impl.execution.f$a.run(L:926)
at java.lang.Thread.run(Unknown Source)