1. Order Flow Cumulative Delta (Bid Ask) set to display Period Bar rather than Session so that I can see the net volume (hitting at or above the ask minus that which is hitting at or below the bid ).
2. Buy sell volume
The Buy sell volume indicator is plotting to things:
1. the total volume transacting at or above the ask. plotted as "Buys"
2. the total volume transacting at or below the bid. plotted as "Sells"
I'm expecting that subtracting sells from buys would produce the same delta value that's being plotted by the Order Flow Cumulative delta as I have it configured. But that's not what I'm seeing. The values are different.
For example see this screenshot:
Here we see Order Flow's Delta Close plotting 14.
Buy sell volume is plotting buys 248, sells 117. The math: 248 - 117 = 131
EDIT: I was expecting the result to be 14 to match Delta Close plotting. Also I just noticed that the Volume for the bar is also 248. I would expect the sum of the Buys and Sells to equal 248.
The code for Buy sell volume is:
protected override void OnMarketData(MarketDataEventArgs e) { if(e.MarketDataType == MarketDataType.Last) { if(e.Price >= e.Ask) buys += (Instrument.MasterInstrument.InstrumentType == Cbi.InstrumentType.CryptoCurrency ? Core.Globals.ToCryptocurrencyVolume(e.Volume) : e.Volume); else if (e.Price <= e.Bid) sells += (Instrument.MasterInstrument.InstrumentType == Cbi.InstrumentType.CryptoCurrency ? Core.Globals.ToCryptocurrencyVolume(e.Volume) : e.Volume); } }
Comment