Dukascopy
 
 
Wiki JStore Search Login

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

    Try to find an answer in Wiki before asking a question.
    Submit programming questions in this forum only.
    Off topics are strictly forbidden.

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

How to create a custom period?
 Post subject: How to create a custom period? Post rating: 0   New post Posted: Fri 19 Feb, 2010, 13:38 

User rating: -
Hello.

This piece of code:

public void onBar(Instrument instrument, Period period, IBar askBar, IBar bidBar) throws JFException {
   Period per = new Period(Unit.Hour, 2); 
      bar = history.getBar(instrument,per,OfferSide.BID,0);
}


Compiles Ok but returns this error: java.lang.ArrayIndexOutOfBoundsException: -1 @ com.dukascopy.charts.data.datacache.ax.a(Unknown Source)

Some help please?. How to download 2-hours time period, or any custom period?

Thanks in advanced.


 
 Post subject: Re: How to create a custom period? Post rating: 0   New post Posted: Tue 23 Feb, 2010, 09:46 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Hello,
It's not possible to download custom period bars.
To get two hour period bars, you need to download, for example, ONE_HOUR bars and then calculate your custom period bar from downloaded bars.


 

Jump to:  

  © 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