Dukascopy
 
 
Wiki JStore Search Login

JFOREX-1653: getBarsCount(...)
 Post subject: JFOREX-1653: getBarsCount(...) Post rating: 0   New post Posted: Sun 11 Apr, 2010, 20:54 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
could you please consider including a function that returns the number of filtered bars between two times:

int getBarsCount(Instrument instrument, Period period, OfferSide side, Filter filter, long from, long to);


Thanks a lot,
RR.


 
 Post subject: Re: JFOREX-1653: getBarsCount(...) Post rating: 0   New post Posted: Fri 30 Apr, 2010, 19:52 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Please take a look at getBars(...).size()


 
 Post subject: Re: JFOREX-1653: getBarsCount(...) Post rating: 0   New post Posted: Mon 03 May, 2010, 09:07 
User avatar

User rating: 3
Joined: Wed 18 May, 2011, 16:25
Posts: 331
Location: SwitzerlandSwitzerland
yes, sure, that's how we do it at the moment.
But it comes with some resource overhead. That's why we thought it might be good to have a function that does not return a list of bar objects, but only the number of bars.

Best, RR.


 
 Post subject: Re: JFOREX-1653: getBarsCount(...) Post rating: 0   New post Posted: Thu 06 May, 2010, 09:24 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
You can use readBar() method and cound bars in listener. This way it will not keep bars in memory and it's safe to run with long periods


 

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