Dukascopy
 
 
Wiki JStore Search Login

bidBar hourly data behind 1 hour in api vs. chart?
 Post subject: bidBar hourly data behind 1 hour in api vs. chart? Post rating: 0   New post Posted: Mon 27 May, 2013, 23:43 
User avatar

User rating: 0
Joined: Thu 02 May, 2013, 23:00
Posts: 6
Hello,

when reading bidBar data (close, open) I get different values than on the chart. It seems the data from the api are one hour behind the data on the chart.
E.g. on the USD/JPY chart from Jan. 2010 onn 15th 0:00:
The chart reads bidBar.close = 91.23. (see chart)
The api returns 91.27 which is the close from 14th, 23:00. The log entry comes from the code snippet attached.

What am I doing wrong? Or is that a bug?

Many thanks in advance!


Attachments:
USDJPY_Chart_201001.png [36.66 KiB]
Downloaded 362 times
File comment: Log entry
Fri Jan 15 00:00:00 CET 2010c = 91.27 o = 91.24

Log_Screenshot.png [46.36 KiB]
Downloaded 356 times
File comment: log entry stems comes from:
log(new Date(bidBar.getTime()) + "c = " + bidBar.getClose() + " o = " + bidBar.getOpen());

Code_Snipptet.png [35.67 KiB]
Downloaded 353 times
DISCLAIMER: Dukascopy Bank SA's waiver of responsability - Documents, data or information available on this webpage may be posted by third parties without Dukascopy Bank SA being obliged to make any control on their content. Anyone accessing this webpage and downloading or otherwise making use of any document, data or information found on this webpage shall do it on his/her own risks without any recourse against Dukascopy Bank SA in relation thereto or for any consequences arising to him/her or any third party from the use and/or reliance on any document, data or information found on this webpage.
 
 Post subject: Re: bidBar hourly data behind 1 hour in api vs. chart? Post rating: 0   New post Posted: Wed 05 Jun, 2013, 21:56 
User avatar

User rating: 0
Joined: Thu 02 May, 2013, 23:00
Posts: 6
Hello Dukascopy Support,

do you need additional information?

Best regards,
cnt64


 
 Post subject: Re: bidBar hourly data behind 1 hour in api vs. chart? Post rating: 1   New post Posted: Fri 07 Jun, 2013, 12:21 
User avatar

User rating: 164
Joined: Mon 08 Oct, 2012, 10:35
Posts: 676
Location: NetherlandsNetherlands
Hi,

I am not sure if
new Date(bidBar.getTime())

is also a good and proper way to get the time of the bar, but what I use SimpleDateFormat, which is described here: https://www.dukascopy.com/wiki/#Format_Date_Time

There is another wiki page that contains a checklist that you have to consider when comparing chart data with strategy calculations:
https://www.dukascopy.com/wiki/#Indicato ... _checklist

I also must say that you probably have better chances for support and help, if you provide the complete strategy. As currently it is not visible where (in what context) do you call your log() functions, etc.

And at last, this is definitely an Automated Trading issue. Normally API Support picks up these threads within 1-3 days.
The thread is currently in the Trading Platform`s Bug Report section, which is handled by Desktop Support, but Desktop Support (sadly) is ridiculously slow in response times...
I suggest to wait till mid-next week (as there is no support on the weekend at all), and if there is no response, re-post in the Automated Trading section.


 
 Post subject: Re: bidBar hourly data behind 1 hour in api vs. chart? Post rating: 0   New post Posted: Fri 07 Jun, 2013, 21:46 
User avatar

User rating: 0
Joined: Thu 02 May, 2013, 23:00
Posts: 6
Hi tcsabina,

many thanks for the hints!
I checked the date stuff and that seems to be the problem. When using Date class I'm not able to change the timezone. The default timezone of Date class is GMT but if my machine uses a different timezone, a conversion will take place. If I use SimpleDateFormat and set the timezone the bid/ask Bar time conforms the chart.
Since the difference of time is seen on the chart, I thought this is a trading platform issue.

And many thanks for the heads-up on the support response time!


 

Jump to:  

cron
  © 1998-2025 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