예제 #1
0
 public override void OnUpdate(int itemPos, string itemName, IUpdateInfo update)
 {
     try
     {
         L1LsPriceData priceData = L1LsPriceUpdateData(itemPos, itemName, update);
         foreach (var data in (from MarketData mktData in MarketData where itemName.Contains(mktData.Id) select mktData).ToList())
         {
             var curTime = Config.ParseDateTimeUTC(priceData.UpdateTime).AddHours(time_offset_hours);
             if (Config.PublishingOpen(curTime))
             {
                 data.FireTick(curTime, priceData); // Timestamps from IG are GMT (i.e. equivalent to UTC)
             }
         }
     }
     catch (SEHException exc)
     {
         Log.Instance.WriteEntry("Market data update interop error: " + exc.ToString() + ", Error code: " + exc.ErrorCode, EventLogEntryType.Error);
     }
     catch (Exception ex)
     {
         Log.Instance.WriteEntry("Market data update error: " + ex.ToString(), System.Diagnostics.EventLogEntryType.Error);
         throw;
     }
 }
예제 #2
0
 public void FireTick(DateTime updateTime, L1LsPriceData value)
 {
     FireTick(updateTime, new Price(value));
 }
예제 #3
0
 public Price(L1LsPriceData priceData)
 {
     this.Bid    = priceData.Bid.Value;
     this.Offer  = priceData.Offer.Value;
     this.Volume = priceData.Volume;
 }