protected virtual void OnLevel1FundamentalEvent(Level1FundamentalEventArgs e) { if (Level1FundamentalEvent != null) { Level1FundamentalEvent(this, e); } }
private void OnLevel1FundamentalEvent(object sender, Level1FundamentalEventArgs e) { // handle split data, they're only valid today, they'll show up around 4:45am EST if (e.SplitDate1.Date == DateTime.Today && DateTime.Now.TimeOfDay.TotalHours <= 8) // they will always be sent premarket { // get the last price, if it doesn't exist then we'll just issue the split claiming the price was zero // this should (ideally) never happen, but sending this without the price is much better then not sending // it at all double referencePrice; _prices.TryGetValue(e.Symbol, out referencePrice); var sid = SecurityIdentifier.GenerateEquity(e.Symbol, Market.USA); var split = new Split(new Symbol(sid, e.Symbol), FeedTime, (decimal)referencePrice, (decimal)e.SplitFactor1); _dataQueue.Add(split); } }