private void ShowMarketDataReceiverInfo() { CTPMarketDataReceiver receiver = USeManager.Instance.MarketDataReceiver; this.lblReceive_InstrumentCount.Text = receiver.InstrumentCount.ToString(); this.lblReceive_ReceiveCount.Text = receiver.ReceiveCount.ToString(); this.lblReceive_LatestMarketDataTime.Text = receiver.LastMarketDataTime.HasValue? receiver.LastMarketDataTime.Value.ToString("HH:mm:ss"): "---"; }
/// <summary> /// 创建行情数据接收器。 /// </summary> private void CreateMarketDataReceiver() { try { //读取配置文件 CtpReceiverSection config = CtpReceiverSection.GetSection(); string dbConnStr = ConfigurationManager.ConnectionStrings["KLineDB"].ConnectionString; string alphaDBName = ConfigurationManager.AppSettings["AlphaDBName"]; CTPMarketDataReceiver receiver = new CTPMarketDataReceiver(config, dbConnStr, alphaDBName); receiver.Notify += OnNotifyEventArrived; m_marketDataReceiver = receiver; string text = String.Format("{0} Create {1} OK.", this, receiver); m_eventLogger.WriteInformation(text); } catch (Exception ex) { string text = "Create MarketDataReceiver object failed, " + ex.Message; throw new ApplicationException(text, ex); } }