Пример #1
0
        // 请求查询报单
        public override bool GetOrders(QryOrder qry, ref List <OrderInfo> refOrders)
        {
            bool result = false;

            lock (this)
            {
                string szHashId = "o:" + RunSingleStrategy.StrategyInfo.TraderName;
                string szInst   = qry.InstrumentID;

                List <string> keyList = new List <string>();

                byte[][] para = Redis.HKeys(szHashId);
                foreach (byte[] elem in para)
                {
                    string szValue = Tool.GetString(elem);
                    keyList.Add(szValue);
                }

                foreach (string key in keyList)
                {
                    //目前不用考虑特定合约的情况,只关心用户,每次返回该用户的所有报单
                    //if (key.Contains(szInst))
                    //{
                    OrderInfo orderInfo = new OrderInfo();
                    byte[]    bValue    = Redis.HGet(szHashId, Tool.GetBytes(key));
                    string    szValue   = Tool.GetString(bValue);
                    xmlOpr.Transfer(szValue, ref orderInfo);
                    refOrders.Add(orderInfo);
                    result = true;
                    //}
                }
            }
            return(result);
        }
Пример #2
0
 // 请求查询报单
 public abstract bool GetOrders(QryOrder qry, ref List <OrderInfo> retOrders);