예제 #1
0
        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);
            }
        }
예제 #2
0
 public void UpdateTimeNSales(TimeNSalesData tnsData)
 {
     _timeNSalesList.Add(tnsData);
 }