Dukascopy
 
 
Wiki JStore Search Login

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

    Submit JForex API function requests in this forum only.
    Off topics are strictly forbidden.

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

Filter parameter missing in IHistory methods
 Post subject: Filter parameter missing in IHistory methods Post rating: 0   New post Posted: Tue 21 Dec, 2021, 13:16 

User rating: 0
Joined: Fri 28 Feb, 2020, 14:55
Posts: 9
Location: Bulgaria,
Similar to methods that have 2 versions - without filter and with filter:

getBars(Instrument instrument, Period period, OfferSide side, long from, long to)
getBars(Instrument instrument, Period period, OfferSide side, Filter filter, long from, long to)


Please add method overloading where it is needed, like here:

getBar(Instrument instrument, Period period, OfferSide side, int shift)
getBar(Instrument instrument, Period period, OfferSide side, Filter filter, int shift) <--- MISSING

getTimeForNBarsForward(Period period, long from, int numberOfBars)
getTimeForNBarsForward(Period period, Filter filter, long from, int numberOfBars) <--- MISSING

getTimeForNBarsBack(Period period, long to, int numberOfBars)
getTimeForNBarsBack(Period period, Filter filter, long to, int numberOfBars) <--- MISSING

getPreviousBarStart(Period period, long barTime)
getPreviousBarStart(Period period, Filter filter, long barTime) <--- MISSING


 
 Post subject: Re: Filter parameter missing in IHistory methods Post rating: 0   New post Posted: Thu 06 Jan, 2022, 14:39 
Visual JForex expert at Dukascopy
User avatar

User rating:
Joined: Mon 22 Apr, 2013, 11:30
Posts: 604
Location: UkraineUkraine
Greetings.

Methods getTimeForNBarsForward, getTimeForNBarsBack, getPreviousBarStart implemented as simple calendar calculations - they don't take into account trading breaks schedule.
You can use com.dukascopy.api.IHistory#getBars(com.dukascopy.api.Instrument, com.dukascopy.api.Period, com.dukascopy.api.OfferSide, com.dukascopy.api.Filter, int, long, int) method to load necessary number of bars and take time from corresponding bar.

Method getBar(Instrument instrument, Period period, OfferSide side, int shift) determines time of requested bar in the same manner, therefore it also can't use Filter.

Regards.


 

Jump to:  

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