Exemple #1
0
        //登陆
        public void Login(Account account)
        {
            if (account != null && mQuoter.IsLogin)
            {
                return;
            }

            mAccount = account;

            //前置连接回调
            mQuoter.OnFrontConnected += (object sender, EventArgs e) =>
            {
                mQuoter.ReqUserLogin(account.Investor, account.Password, account.Broker);
                LogUtils.EnginLog("ctpmd:OnFrontConnected");
            };
            //登陆回调
            mQuoter.OnRspUserLogin += (object sender, IntEventArgs e) =>
            {
                mQuoter.ReqSubscribeMarketData(mSubscribeMap.Keys.ToArray <string>());
                LogUtils.EnginLog("ctpmd:OnRspUserLogin:"******"ctpmd:OnRspUserLogout");
            };
            //行情回调
            mQuoter.OnRtnTick += _onTick;
            //错误回调
            mQuoter.OnRtnError += (object sender, ErrorEventArgs e) =>
            {
                LogUtils.EnginLog("OnRtnError:" + e.ErrorMsg);
            };

            //开始连接
            mQuoter.ReqConnect(account.Server);
        }
Exemple #2
0
 public void Run()
 {
     _q.ReqConnect("tcp://180.168.146.187:10010");
 }