/// <summary> /// Post data /// </summary> private void PostData(decimal open, decimal close, decimal high, decimal low) { Bar bar = new Bar(new Security { Symbol = _security.Symbol }, "Bar Factory", "", DateTime.UtcNow) { Open = open, Close = close, High = high, Low = low, Volume = 0 }; if (Logger.IsInfoEnabled) { Logger.Info(this._security + " - Posting new bar - " + bar, _type.FullName, "PostData"); } // Post new bar. if (BarArrived != null) { if (Logger.IsDebugEnabled) { Logger.Debug("Number of subscribers to bar factory: " + BarArrived.GetInvocationList(), _type.FullName, "PostData"); } BarArrived(bar, BarGeneratorKey); } }
/// <summary> /// Raised when a new Bar Arrives from the MarketDataControler /// </summary> private void MarketDataControlerBarArrived(Bar bar) { if (BarArrived != null) { BarArrived.Invoke(bar, bar.RequestId); } }