Dukascopy Support Board
http://www.dukascopy.com/swiss/english/forex/jforex/forum/

IHistory getBarStart(Period period, long time) time zone
http://www.dukascopy.com/swiss/english/forex/jforex/forum/viewtopic.php?f=16&t=57288
Page 1 of 1

Author:  pminc74 [ Thu 12 Mar, 2020, 12:49 ]
Post subject:  IHistory getBarStart(Period period, long time) time zone

Hi,

According to my tests, the IHistory:getBarStart(Period period, long time) method returns the candle start time always in GMT time zone, regardless current time zone settings (on client machine, on platform settings). It is meaningful in higher periods (four hours, daily, weekly ...).

Is that correct?

The same is for getTimeForNBarsForward() and probalby other fmethods of IHistory.

Author:  pminc74 [ Fri 13 Mar, 2020, 14:51 ]
Post subject:  Re: IHistory getBarStart(Period period, long time) time zone

My workaround is as follows:


Long dateTimeGMT = toTimeZoneGMT(dateTime); // convert value to GMT zone, my util function

Long barStartTime = this.getHistory().getBarStart(period, dateTimeGMT); // or other IHistory method

Long returnValue = toTimeZoneCET(barStartTime); // convert back to my zone, my util function

Author:  pminc74 [ Mon 16 Mar, 2020, 15:00 ]
Post subject:  Re: IHistory getBarStart(Period period, long time) time zone

This problem occurs, when connecting through com.dukascopy.api.system.IClient.

When calling IHistory methods from Indicator -> is OK.

Author:  API Support [ Tue 24 Mar, 2020, 17:57 ]
Post subject:  Re: IHistory getBarStart(Period period, long time) time zone

Greetings

That problem was discussed and solved on the forum:
https://www.dukascopy.com/swiss/english ... 468#p93468

Best regards, API Support.

  Page 1 of 1