Dukascopy
 
 
Wiki JStore Search Login

Attention! Read the forum rules carefully before posting a topic.

    Submit JForex API bug reports in this forum only.
    Submit Converter issues in Converter Issues.
    Off topics are strictly forbidden.

Any topics which do not satisfy these rules will be deleted.

IHistory getBarStart(Period period, long time) time zone
 Post subject: IHistory getBarStart(Period period, long time) time zone Post rating: 0   New post Posted: Thu 12 Mar, 2020, 12:49 

User rating: 3
Joined: Fri 15 Nov, 2019, 12:54
Posts: 16
Location: Poland,
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.


 
 Post subject: Re: IHistory getBarStart(Period period, long time) time zone Post rating: 0   New post Posted: Fri 13 Mar, 2020, 14:51 

User rating: 3
Joined: Fri 15 Nov, 2019, 12:54
Posts: 16
Location: Poland,
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


 
 Post subject: Re: IHistory getBarStart(Period period, long time) time zone Post rating: 0   New post Posted: Mon 16 Mar, 2020, 15:00 

User rating: 3
Joined: Fri 15 Nov, 2019, 12:54
Posts: 16
Location: Poland,
This problem occurs, when connecting through com.dukascopy.api.system.IClient.

When calling IHistory methods from Indicator -> is OK.


 
 Post subject: Re: IHistory getBarStart(Period period, long time) time zone Post rating: 0   New post Posted: Tue 24 Mar, 2020, 17:57 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Greetings

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

Best regards, API Support.


 

Jump to:  

  © 1998-2024 Dukascopy® Bank SA
On-line Currency forex trading with Swiss Forex Broker - ECN Forex Brokerage,
Managed Forex Accounts, introducing forex brokers, Currency Forex Data Feed and News
Currency Forex Trading Platform provided on-line by Dukascopy.com