public static OrderBookLevel CreateDeleted(LimitOrder order) { return(new OrderBookLevel { Direction = order.GetOrderDirection(), Instrument = order.Instrument, Volume = 0, Price = order.Price }); }
public void AddMarketMakerOrder(LimitOrder order) { var src = order.GetOrderDirection() == OrderDirection.Buy ? Buy : Sell; if (!src.ContainsKey(order.Price)) { src.Add(order.Price, new List <LimitOrder>()); } var existingOrder = src[order.Price].FirstOrDefault( item => item.MarketMakerId == order.MarketMakerId); if (existingOrder != null) { existingOrder.Volume = order.Volume; } src[order.Price].Add(order); UpdateBestPrice(); }