I am trying to figure out what the process would be to calculate what the Bid/Ask volume traded at each price. We have the following snippet of code which will update whenever the number of available Bids or Offers updates or some quantity of contracts was traded at the Last price. When the Bid or the Ask volume change, this does not necessarily mean any quantity was traded at those prices, it could just be that more Bids or Offers were added or taken away from those prices. :
protected override void OnMarketData(MarketDataEventArgs marketDataUpdate)
{
// Print some data to the Output window
if (marketDataUpdate.MarketDataType == MarketDataType.Last)
Print(string.Format("Last = {0} {1} ", marketDataUpdate.Price, marketDataUpdate.Volume));
else if (marketDataUpdate.MarketDataType == MarketDataType.Ask)
Print(string.Format("Ask = {0} {1} ", marketDataUpdate.Price, marketDataUpdate.Volume));
else if (marketDataUpdate.MarketDataType == MarketDataType.Bid)
Print(string.Format("Bid = {0} {1}", marketDataUpdate.Price, marketDataUpdate.Volume));
}
If you were to take the above code and add up for the volume for each bar and run it on a 200 tick chart you will notice that the Last quantity broadly adds up to 200 and the Bid and Ask volume is in the thousands. So I am guessing you have to infer the Bid and Ask by perhaps tracking the Delta between consecutive Last updates?
My question is how do these market footprint indicators infer the numbers at the various levels for the Bid and Ask volume traded?
Comment