Ok, so, i'm storing every event from DOM(1&2)
Whenever i want to get the entire ladder, I can, of course, just go back to old events... and rebuild the ladder.
Now.. the problem comes up when the market makes 1 or more ticks of spread (example: NQ makes 1 tick of spread sometimes)
The method that reconstructs the ladder, doesn't know this because is based in data from previous events.
So, how do i get, let's say the "GetCurrentAsk()" and "GetCurrentBid()" inside of an AddOn? (without dependance of the calling file)
I save the Instrument when I instance the main class. I don't know if i can access from there.
I'm open to new ideas.
One idea, would be to get both 0 Position...
double pos0 = Data.First(p => p.Position == 0); double Ask0 = Data.First(p => p.Position == 0 && p.MarketDataType == MarketDataType.Ask && p.Time <= pos0.Time); double Bid0 = Data.First(p => p.Position == 0 && p.MarketDataType == MarketDataType.Bid && p.Time <= pos0.Time); if (Ask0.Price - TickSize != Bid0.Price) // we have spread
My regards.
Fernando.
Comment