Dukascopy
 
 
Wiki JStore Search Login

JFOREX-3709 getTotalAskVolume() emits NullPointerException
 Post subject: JFOREX-3709 getTotalAskVolume() emits NullPointerException Post rating: 0   New post Posted: Thu 12 Apr, 2012, 14:42 

User rating: 0
Joined: Thu 12 Apr, 2012, 14:26
Posts: 2
I'm trying to get a totalvolume of an old tick by using getToalAskVolume().
My code is something like shown below:

List<ITick> myticks =
          history.getTicks(Instrument.EURUSD, (tmptime-1*60*60*1000),tmptime);
double mytotal;
mytotal = myticks.get(100).getTotalAskVolume();


This code can be compliled. But when I run it, it emits NullPointerException.
What is wrong? Any advise would be appreciated.


 
 Post subject: Re: getTotalAskVolume() emits NullPointerException Post rating: 0   New post Posted: Thu 12 Apr, 2012, 15:11 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
Apparently there are less than 100 ticks in the list. You can check the list size by myticks.size().


 
 Post subject: Re: getTotalAskVolume() emits NullPointerException Post rating: 0   New post Posted: Thu 12 Apr, 2012, 15:46 

User rating: 0
Joined: Thu 12 Apr, 2012, 14:26
Posts: 2
Thank you quick response.
myticks.size() shows more than 2000. Even if it is set as
mytotal = myticks.get(0).getTotalAskVolume(); , it emits NullPointerException.


 
 Post subject: Re: JFOREX-3709 getTotalAskVolume() emits NullPointerException Post rating: 0   New post Posted: Thu 12 Apr, 2012, 16:07 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
The issue has been registered. Please use ITick.getAskVolume().


 
 Post subject: Re: JFOREX-3709 getTotalAskVolume() emits NullPointerException Post rating: 0   New post Posted: Mon 30 Apr, 2012, 11:59 
User avatar

User rating:
Joined: Fri 31 Aug, 2007, 09:17
Posts: 6139
NullPointerException problem is fixed for a historical data in build 2.6.66.

ITick.getTotalAskVolume() supports live ticks only.
Historical Ticks data / cached ticks data has no any information about top bid/ask prices/volumes.
For historical ticks, this information is based on the getAsk() / getBid() / getAskVolume() / getBidVolume() prices/volumes.


 

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