The logic utilizes below event to react to changes in DOM
private void OnMarketDepth(object sender, MarketDepthEventArgs e)
{….}
In order to analyze various levels of DOM, I have the following logic:
if ( e.MarketDataType == MarketDataType.Ask && e.Position == 0)
ask = e.Price;
if ( e.MarketDataType == MarketDataType.Bid && e.Position == 0)
bid = e.Price;
This logic gets me the nearest bid and ask prices. However, there are a lot of times when values in either ask or bid are 0. This should not happen as there is always ask and bid even of the spread between them widens.
Why does this happen?
Is there a better way of coding to retrieve bid and ask then above?
Thanks,
redduke
Comment