Example #1
0
        public void OnConnectionStatus_MarketData(object sender, ConnectionStatus status, ref LoginInfo userLogin)
        {
            this.marketDataLoginInfo = userLogin;
            logUtils.WriteLog("登陆数据服务器:" + status);
            logUtils.WriteLog("用户:" + userLogin.AccountID + "|" + userLogin.InvestorName);

            if (status == ConnectionStatus.Logined)
            {
                //登陆成功Beep
                System.Media.SystemSounds.Beep.Play();

                Type type = currentMarket.GetType();

                //string[] nameDescArr = PluginAssembly.GetPluginNameDesc(type);
                ////如果交易日期改了,需要重新创建一个tickbarwriter,否则程序隔夜跑的时候
                //int date = marketDataLoginInfo.TradingDay;
                //if (this.tickDataReceiver == null || this.tickDataReceiver.Date != date)
                //{
                //    //TODO tickbarwriter需要flush一下
                //    this.marketPath = path + "\\" + nameDescArr[0] + "\\";
                //    this.tickDataReceiver = new DataReceiver_Tick(marketPath, marketDataLoginInfo.TradingDay);
                //    if (onReceiverPrepared != null)
                //        onReceiverPrepared(this, tickDataReceiver);
                //}
            }
        }