Dukascopy
 
 
Wiki JStore Search Login

JFOREX-2252 : history.getBar(...) for custom periods
 Post subject: JFOREX-2252 : history.getBar(...) for custom periods Post rating: 0   New post Posted: Sun 19 Sep, 2010, 13:20 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
Hi,

I guess, the API does not yet support custom periods to retrieve bars from IHistory?
Is that right, or am I missing something?

I've tried to retrieve 30sec bars with the following code:

Period period = Period.createCustomPeriod(Unit.Second, 30);
history.getBar(instrument, period, offerSide, shift);


and the call was throwing the following exception:

Quote:
com.dukascopy.api.JFException: Could not load bar for instrument [EUR/USD], period [30 Secs], side [Ask], start time [2009.12.09 23:59:30 000], current bar start time [2009.12.10 00:00:00 000]


If the IHistory API is not allowing to retrieve customPeriods with the current release, when about can we expect this functionality to be available?

Thanks for a feedback!
Best regards,
RR.


 
 Post subject: Re: history.getBar(...) for custom periods Post rating: 0   New post Posted: Mon 20 Sep, 2010, 02:37 

User rating: 0
Joined: Fri 07 May, 2010, 02:59
Posts: 61
I can't comment on your question directly, but I can comment on some experiments I've been trying recently.

It is our (the group I work with) contention that the start/end time under consideration for H4 bars (and higher timeframes) can significantly alter your results.

As an example, if you end a daily bar at midnight UTC, that's either 7 or 8 hours before London session opens, so while highs & lows are likely to be fairly similar across the various 'end of day' times you might choose, the open & close prices can vary significantly. If you're using pivots, open/close prices can have a lot of impact on the pivots chosen.

As a result of this logic (whether our belief is true or not), we've been creating our own 'previous day bar' instead of using the history daily bar. It requires a tad bit more work, but it works well and we've been happy with the results.

I wouldn't recommend querying the history API to build bars all the time if you need, say, 3 or 11 minute bars or whatever, but it would seem reasonable to use onBar() that aggregates for you. It shouldn't slow things down for you at all, but you won't be able to use these custom bars in indicators.

-Brian


 
 Post subject: Re: history.getBar(...) for custom periods Post rating: 0   New post Posted: Mon 20 Sep, 2010, 08:44 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
Hi Brian,

thanks a lot for your comment and insight.
We too have played around with the beginning times of the higher hour-c/s, especially with shifting them to be in sync with the starting hour of main markets, or by working with "shifted" last n-bars before opening of each of the main markets (European/US/Asian). This leads to several shifted zones during the day and "overlapping" c/s.

The reason we're so much looking forward to working with generated/custom periods (as well as range-bars) is, because we want to use them in indicators.

Thanks again for your message.
Have a good day,
RR.


 
 Post subject: Re: history.getBar(...) for custom periods Post rating: 0   New post Posted: Tue 21 Sep, 2010, 19:54 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
Hello@Dukascopy-Support,

any statement on my initial questions
>> I guess, the API does not yet support custom periods to retrieve bars from IHistory?
and
>> If the IHistory API is not allowing to retrieve customPeriods with the current release, when about can we expect this functionality to be available?
?

Thanks for any feedback,
RR.


 
 Post subject: Re: history.getBar(...) for custom periods Post rating: 0   New post Posted: Wed 22 Sep, 2010, 14:43 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hi RR,
Thanks for your attention, this will be fixed ASAP.


 

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