Ejemplo n.º 1
0
        void DataApi_OnFrontEvent(object sender, OnFrontEventArgs e)
        {
            Console.WriteLine("=====> " + e.EventType);

            switch (e.EventType)
            {
            case EnumOnFrontType.OnFrontConnected:
            {
                MdReqUserLogin();
            }
            break;
            }
        }
Ejemplo n.º 2
0
        void TraderApi_OnFrontEvent(object sender, OnFrontEventArgs e)
        {
            Console.WriteLine("=====> " + e.EventType);

            switch (e.EventType)
            {
            case EnumOnFrontType.OnFrontConnected:
            {
                ReqAuthenticate();
            }
            break;
            }
        }
Ejemplo n.º 3
0
 void DataApi_OnFrontEvent(object sender, OnFrontEventArgs e)
 {
     switch (e.EventType)
     {
     case EnumOnFrontType.OnFrontConnected:
     {
         var req = new ThostFtdcReqUserLoginField();
         req.BrokerID = this.txtBrokerID.Text;
         req.UserID   = this.txtUserID.Text;
         req.Password = this.txtPasswd.Text;
         int iResult = DataApi.ReqUserLogin(req, ++iRequestID);
     }
     break;
     }
 }
Ejemplo n.º 4
0
 void TraderApi_OnFrontEvent(object sender, OnFrontEventArgs e)
 {
     switch (e.EventType)
     {
     case EnumOnFrontType.OnFrontConnected:
     {
         var req = new ThostFtdcReqUserLoginField();
         req.BrokerID = BrokerID;
         req.UserID   = user;
         req.Password = pass;
         int iResult = TraderApi.ReqUserLogin(req, ++iRequestID);
     }
     break;
     }
 }
Ejemplo n.º 5
0
        /*
         * --------------------------------------------------------------
         * 通用回应事件:连接/错误回应/错误返回/正常回应
         * --------------------------------------------------------------
         */
        private void TraderApi_OnFrontEvent(object sender, OnFrontEventArgs e)
        {
            switch (e.EventType)
            {
            case EnumOnFrontType.OnFrontConnected:
            {
                ReqUserLogin();
            }
            break;

            default:
            {
                HandleStatusInternal("CTP前置机断开连接:nReason = " + e.Reason);
            }
            break;
            }
        }
Ejemplo n.º 6
0
        void TraderApi_OnFrontEvent(object sender, OnFrontEventArgs e)
        {
            switch (e.EventType)
            {
            case EnumOnFrontType.OnFrontConnected:
            {
                if (chkAuthenticate.Checked)
                {
                    var req = new ThostFtdcReqAuthenticateField();
                    req.BrokerID = txtBrokerID.Text;
                    req.UserID   = txtUserID.Text;
                    req.AppID    = txtAppID.Text;
                    req.AuthCode = txtAuthCode.Text;

                    TraderApi.ReqAuthenticate(req, ++iRequestID);
                }
                else
                {
                    ReqUserLogin();
                }
            }
            break;
            }
        }