What is the most efficient way to figure out which level on DOM has the largest size for bid and ask? I have the following logic within OnMarketDepth event (ask example):
maxValue=0;
maxAskSizeLevel=0;
for(int i=0; i<5; i++)
{
if (e.MarketDepth.Ask[i].Volume > maxValue)
maxValue = e.MarketDepth.Ask[i].Volume;
maxAskSizeLevel = i;
}
But I am afraid that with all the changes that take place it might be too slow. Is there anyway to get this data with some kind of max function?
Thanks,
redduke
Comment