during the attempt to make sense of Volume and understand its calculation, I found that there are 3 different ways to get Ask/Bid Volume in NT8.
- The GetCurrentAsk/BidVolume function seems to show only a fraction of the actual volume. I guess it might be the temporary offered limit orders, not the actually traded volume.
- The BuySellVolume Indicator (which seems to be coded and calculated differently than the BuySellVolume function) shows all volume expect the Volume in-between bid and ask (https://ninjatrader.com/support/help...sellvolume.htm), which is on some days for each bar exactly the same over a long period (even days), and on some days non-existent (I got the 'neutral' volume from adding the following to the BuySellVolume indicator's OnMarketData
else{
neutralV += (Instrument.MasterInstrument.InstrumentType == Cbi.InstrumentType.CryptoCurrency ? Core.Globals.ToCryptocurrencyVolume(e.Volume) : e.Volume);}
- Lastly you can get the ask/bid volume by calling BuySellVolume().Buys/Sells. The outcome is an almost identical volume to the BuySellVolume indicator value. Only at some bars the volume diverges by being a few percent less.
I see that the volume shown by the BuySellVolume matches the volume of the VOL indicator exactly. Therefore I assume it's the most appropriate one.
I wonder if there can be any volume in-between bid and ask at all? I mean if there is a gap nobody trades there, and if somebody trades there, the gap automatically disappears for this second of the trade. Nevertheless I saw the indicator show some 'neutral' volume. Any idea why or how?
This brings me to my next question: is the volume that is traded at the bid or the ask the entire traded Volume in any case (expect for the trades apart from the normal broker network)? I mean in general with orderflow analysis, is the bid/ask volume the absolute volume? Can't find an answer somewhere.
Further I wonder why the volume from the BuySellVolume() function is slightly smaller than the output of the BuySellVolume Indicator, since it gets the value from the BuySellVolume Indicator how I understand it. This happens also during times when the 'neutral' volume is zero.
I don't have the BuySellVolume.() function coded with if(BarsInProgress == 0) / == 1). Might this be the reason?
Regards,
Sebastian

Comment