public void OnTimeNSalesUpdate(Win32.TimeNSalesData tnsPacket) { try { TimeNSalesData tnsData = new TimeNSalesData(); tnsData.Symbol = tnsPacket.caSymbol; DateTime time; bool succ = DateTime.TryParse(tnsPacket.caTimeStamp, out time); tnsData.TimeStamp = time; tnsData.Price = tnsPacket.dPrice; tnsData.Quantity = tnsPacket.iQuantity; tnsData.Direction = GetEntryExitType(tnsPacket.iDirection); EventAggregator.GetEvent <TimeNSalesUpdateEvent>().Publish(tnsData); } catch (System.Exception ex) { LogManager.Logger.ErrorFormat("Time and sales updating error:{0}", ex.Message); } }
public void UpdateTimeNSales(TimeNSalesData tnsData) { _timeNSalesList.Add(tnsData); }