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; } }
public void FireTick(DateTime updateTime, L1LsPriceData value) { FireTick(updateTime, new Price(value)); }
public Price(L1LsPriceData priceData) { this.Bid = priceData.Bid.Value; this.Offer = priceData.Offer.Value; this.Volume = priceData.Volume; }