Dukascopy Support Board http://www.dukascopy.com/swiss/english/forex/jforex/forum/ |
|
How to get dailyBar in different time zones? http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=65&t=56510 |
Page 1 of 1 |
Author: | grosskt [ Mon 14 May, 2018, 16:36 ] | ||
Post subject: | How to get dailyBar in different time zones? | ||
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; ................................................................. 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)
|
Author: | API Support [ Thu 24 May, 2018, 13:18 ] |
Post subject: | Re: How to get dailyBar in different time zones? |
Here best solution would be creation of custom period and make request for bar based on it. JFTimeZone myTimeZone = JFTimeZone.EET;//Here you specify your timeZone, for example - EET |
Author: | grosskt [ Fri 01 Jun, 2018, 10:38 ] |
Post subject: | Re: How to get dailyBar in different time zones? |
*/ but show exception is: java.lang.IllegalArgumentException: JFTimeZone is not appropriate for this unit. Received Unit = Minute, numOfUnits = 30, JFTimeZone = EET with standard offset -7200000(milliseconds) and daylight offset -10800000(milliseconds). Offsets cannot be other than 0 for periods with Unit smaller than Unit.Day. at com.dukascopy.api.Period.createCustomPeriod(Period.java:380) why? how to do? |
Author: | API Support [ Mon 04 Jun, 2018, 15:17 ] |
Post subject: | Re: How to get dailyBar in different time zones? |
Custom period creation with time zone different from UTC is supported only for Units greater than 1-hour. For smaller periods this is meaningless, since their filling will be same regardless of time zone. In your example for the current 30-minutes candle you need just use Period.THIRTY_MINS instead of custom period. |
Page 1 of 1 |