Пример #1
0
        private void OnRspUserLogin(ThostFtdcRspUserLoginField pRspUserLogin, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
        {
            __DEBUGPF__();

            if (bIsLast)
            {
                bool isLogin = !IsErrorRspInfo(pRspInfo);
                if (isLogin)
                {
                    // 保存会话参数
                    FRONT_ID   = pRspUserLogin.FrontID;
                    SESSION_ID = pRspUserLogin.SessionID;
                    int iNextOrderRef = 0;
                    if (!string.IsNullOrEmpty(pRspUserLogin.MaxOrderRef))
                    {
                        iNextOrderRef = Convert.ToInt32(pRspUserLogin.MaxOrderRef);
                    }
                    iNextOrderRef++;
                    iOrderRef = iNextOrderRef;

                    ///获取当前交易日
                    HandleStatusInternal("CTP获取当前交易日 = " + trader.GetTradingDay());

                    ///投资者结算结果确认
                    ReqSettlementInfoConfirm();
                }

                // 通知登录结果
                if (HandleLoginDel != null)
                {
                    HandleLoginDel(isLogin);
                }
            }
        }
Пример #2
0
 void OnRspUserLogin(ThostFtdcRspUserLoginField pRspUserLogin, ThostFtdcRspInfoField pRspInfo, int nRequestID, bool bIsLast)
 {
     DebugPrintFunc(new StackTrace());
     if (bIsLast && !IsErrorRspInfo(pRspInfo))
     {
         // 保存会话参数
         FRONT_ID   = pRspUserLogin.FrontID;
         SESSION_ID = pRspUserLogin.SessionID;
         int iNextOrderRef = 0;
         if (!string.IsNullOrEmpty(pRspUserLogin.MaxOrderRef))
         {
             iNextOrderRef = Convert.ToInt32(pRspUserLogin.MaxOrderRef);
         }
         iNextOrderRef++;
         ORDER_REF = Convert.ToString(iNextOrderRef);
         ///获取当前交易日
         Console.WriteLine("--->>> 获取当前交易日 = " + api.GetTradingDay());
         ///投资者结算结果确认
         ReqSettlementInfoConfirm();
     }
 }