public void onTick(Instrument instrument, ITick tick) throws JFException {
int bPriceCnt = 0;
int aPriceCnt = 0;
int aVolCnt = 0;
int bVolCnt = 0;
double[] bPrices = tick.getBids();
double[] aPrices = tick.getAsks();
double[] bVol = tick.getBidVolumes();
double[] aVol = tick.getAskVolumes();
String Vols;
for ( double i : bVol ) { bVolTotal += i; bVolCnt += 1;}
for ( double i : aVol ) { Vols += "BidVol = " + i/1000000 + "\n";aVolTotal += i; aVolCnt += 1;}
for ( double i : aPrices ) { aPriceCnt += 1;}
for ( double i : bPrices ) { bPriceCnt += 1;}
// print Vols here
}
Using the above code I randomly get 1 extra entry than is shown in the lvl 2 data on the platform. Specificualy with the EUR/USD these extras have 1.25 volume entry for the Ask and 100 volume for the Bid. These seem to be random and the inconsistantcy is a bit troubling. $100,000,000 showing up randomly on the lvl 2 data
Any ideas?
Edit: had bid/ask reversed