private void client_UpdateMktDepth(object sender, UpdateMarketDepthEventArgs e) { if (debug) { log.Debug("Tick ID: " + e.TickerId + " Tick Side: " + EnumDescConverter.GetEnumDescription(e.Side) + " Tick Size: " + e.Size + " Tick Price: " + e.Price + " Tick Position: " + e.Position + " Operation: " + EnumDescConverter.GetEnumDescription(e.Operation)); } }
/// <summary> /// Raised when New Quote Prices are received /// </summary> private void OnUpdateMarketDepth(object sender, UpdateMarketDepthEventArgs eventArgs) { try { lock (_lock) { MarketDepthSide type = eventArgs.Side; if (type.Equals(MarketDepthSide.Ask)) { Tick tick = _tickList[eventArgs.TickerId]; _ask.Security.Symbol = tick.Security.Symbol; _ask.AskSize = eventArgs.Size; _ask.AskPrice = eventArgs.Price; _ask.DateTime = DateTime.Now; if (TickArrived != null) { TickArrived(_ask); } } else if (type.Equals(MarketDepthSide.Bid)) { Tick tick = _tickList[eventArgs.TickerId]; _bid.Security.Symbol = tick.Security.Symbol; _bid.BidSize = eventArgs.Size; _bid.BidPrice = eventArgs.Price; _bid.DateTime = DateTime.Now; if (TickArrived != null) { TickArrived(_bid); } } } } catch (Exception exception) { Logger.Error(exception, _type.FullName, "OnUpdateMarketDepth"); } }
static void client_UpdateMktDepth(object sender, UpdateMarketDepthEventArgs e) { Console.WriteLine("Tick ID: " + e.TickerId + " Tick Side: " + EnumDescConverter.GetEnumDescription(e.Side) + " Tick Size: " + e.Size + " Tick Price: " + e.Price + " Tick Position: " + e.Position + " Operation: " + EnumDescConverter.GetEnumDescription(e.Operation)); }