Example #1
0
        void qryPosiAccount()
        {
            _rtnOrderTime = DateTime.Now;
            //当rtnorder数量过大时,需等待n秒响应时间.避免在旧的rtnorder未响应完成时进行接口操作导致未知错误.
            do
            {
                Thread.Sleep(1100);
            } while ((DateTime.Now - _rtnOrderTime).TotalSeconds <= 1);//  cnt < DicOrderField.Count); //等待rtn响应完成

            //20170113 _excTime = DateTime.MinValue;  //用于取交易所时间

            _t.ReqQryInvestorPosition();

            //权益查询:解决锁仓/套利只收单边保证金的问题
            Thread.Sleep(1100);
            if (IsLogin)
            {
                _t.ReqQryTradingAccount();
            }
            Thread.Sleep(1100);
            IsLogin = true;
            _OnRspUserLogin?.Invoke(this, new IntEventArgs {
                Value = 0
            });

            while (IsLogin)
            {
                _t.ReqQryInvestorPosition();

                //权益查询:解决锁仓/套利只收单边保证金的问题
                Thread.Sleep(1100);
                if (IsLogin)
                {
                    _t.ReqQryTradingAccount();
                }
                Thread.Sleep(1100);
            }
        }