But I don't want to waste CPU cycles updating a separate list "LadderRows" on each DOM update event, when I only need to read the DOM ladder rows every 5 seconds.
I'm wondering if there is a way to directly access the current state of the marketDepth list (or dictionary, whatever type of generic <T> it is) ?
when my event timer fires every 5 seconds, I try...
for (int i = 0; i < NinjaTrader.Data.MarketDepth<NinjaTrader.Data.MarketDepthRow>.Asks.Count; i++)
{
myAskList[i].Price = NinjaTrader.Data.MarketDepth<NinjaTrader.Data.MarketDepthRow>.Asks[i].Price;
myAskList[i].Size = NinjaTrader.Data.MarketDepth<NinjaTrader.Data.MarketDepthRow>.Asks[i].Volume;
}
Is there a way during State.DataLoaded to instantiate a variable that points to the MarketDepth List object, so it can be read directly?
I also read the code in AddOnFramework.cs, but I don't understand how the variable marketDepth is pointed to the data source so it can be read when that button in the add on is clicked.
Thanks for any help.

Comment