Esempio n. 1
0
        public ProtoBufPackage buildPackage()
        {
            Trd_GetOrderList.Request.Builder request = Trd_GetOrderList.Request.CreateBuilder();
            Trd_GetOrderList.C2S.Builder     c2s     = Trd_GetOrderList.C2S.CreateBuilder();
            TrdHeader.Builder headerBuilder          = TrdHeader.CreateBuilder();
            headerBuilder.TrdEnv    = (int)trdenv;
            headerBuilder.AccID     = (ulong)accID;
            headerBuilder.TrdMarket = (int)trdMarket;
            c2s.SetHeader(headerBuilder.Build());
            if (filterConditions != null)
            {
                c2s.FilterConditions = filterConditions;
            }
            if (filterStatusList != null && filterStatusList.Length > 0)
            {
                foreach (int orderID in filterStatusList)
                {
                    c2s.AddFilterStatusList(orderID);
                }
            }


            request.SetC2S(c2s);
            ProtoBufPackage pack = new ProtoBufPackage();

            pack.NProtoID = nProtoID;
            pack.Bodys    = request.Build().ToByteArray();
            return(pack);
        }
        public ProtoBufPackage buildPackage()
        {
            Trd_GetPositionList.Request.Builder request = Trd_GetPositionList.Request.CreateBuilder();
            Trd_GetPositionList.C2S.Builder     c2s     = Trd_GetPositionList.C2S.CreateBuilder();
            TrdHeader.Builder headerBuilder             = TrdHeader.CreateBuilder();
            headerBuilder.TrdEnv    = (int)trdenv;
            headerBuilder.AccID     = (ulong)accID;
            headerBuilder.TrdMarket = (int)trdMarket;
            c2s.SetHeader(headerBuilder.Build());
            if (filterConditions != null)
            {
                c2s.FilterConditions = filterConditions;
            }
            if (filterPLRatioMin != null)
            {
                c2s.FilterPLRatioMin = (double)filterPLRatioMin;
            }
            if (filterPLRatioMax != null)
            {
                c2s.FilterPLRatioMax = (double)filterPLRatioMax;
            }

            request.SetC2S(c2s);
            ProtoBufPackage pack = new ProtoBufPackage();

            pack.NProtoID = nProtoID;
            pack.Bodys    = request.Build().ToByteArray();
            return(pack);
        }
        public ProtoBufPackage buildPackage()
        {
            Trd_GetMaxTrdQtys.Request.Builder request = Trd_GetMaxTrdQtys.Request.CreateBuilder();
            Trd_GetMaxTrdQtys.C2S.Builder     c2s     = Trd_GetMaxTrdQtys.C2S.CreateBuilder();
            TrdHeader.Builder headerBuilder           = TrdHeader.CreateBuilder();
            headerBuilder.TrdEnv    = (int)trdenv;
            headerBuilder.AccID     = (ulong)accID;
            headerBuilder.TrdMarket = (int)trdMarket;
            c2s.SetHeader(headerBuilder.Build());
            c2s.OrderType = (int)orderType;
            c2s.Code      = code;
            c2s.Price     = price;
            if (orderID != null)
            {
                c2s.OrderID = (ulong)orderID;
            }
            if (adjustPrice != null)
            {
                c2s.AdjustPrice = (bool)adjustPrice;
            }
            if (adjustSideAndLimit != null)
            {
                c2s.AdjustSideAndLimit = (double)adjustSideAndLimit;
            }

            request.SetC2S(c2s);
            ProtoBufPackage pack = new ProtoBufPackage();

            pack.NProtoID = nProtoID;
            pack.Bodys    = request.Build().ToByteArray();
            return(pack);
        }
        public ProtoBufPackage buildPackage()
        {
            Trd_ModifyOrder.Request.Builder request = Trd_ModifyOrder.Request.CreateBuilder();
            Trd_ModifyOrder.C2S.Builder     c2s     = Trd_ModifyOrder.C2S.CreateBuilder();

            ProtoBufPackage pack = new ProtoBufPackage();

            TrdHeader.Builder headerBuilder = TrdHeader.CreateBuilder();
            headerBuilder.TrdEnv    = (int)trdenv;
            headerBuilder.AccID     = (ulong)accID;
            headerBuilder.TrdMarket = (int)trdMarket;
            c2s.SetHeader(headerBuilder.Build());

            PacketID.Builder packetID = PacketID.CreateBuilder();
            packetID.ConnID   = (ulong)connID;
            packetID.SerialNo = (uint)pack.NSerialNo;

            c2s.SetPacketID(packetID.Build());
            c2s.OrderID       = (ulong)orderID;
            c2s.ModifyOrderOp = (int)modifyOrderOp;
            if (forAll != null)
            {
                c2s.ForAll = (bool)forAll;
            }
            if (qty != null)
            {
                c2s.Qty = (double)qty;
            }
            if (price != null)
            {
                c2s.Price = (double)price;
            }
            if (adjustPrice != null)
            {
                c2s.AdjustPrice = (bool)adjustPrice;
            }
            if (adjustSideAndLimit != null)
            {
                c2s.AdjustSideAndLimit = (double)adjustSideAndLimit;
            }

            request.SetC2S(c2s);
            pack.NProtoID = nProtoID;

            pack.Bodys = request.Build().ToByteArray();
            return(pack);
        }
        public ProtoBufPackage buildPackage()
        {
            Trd_GetFunds.Request.Builder request       = Trd_GetFunds.Request.CreateBuilder();
            Trd_GetFunds.C2S.Builder     c2s           = Trd_GetFunds.C2S.CreateBuilder();
            TrdHeader.Builder            headerBuilder = TrdHeader.CreateBuilder();
            headerBuilder.TrdEnv    = (int)trdenv;
            headerBuilder.AccID     = (ulong)accID;
            headerBuilder.TrdMarket = (int)trdMarket;
            c2s.Header = headerBuilder.Build();

            request.SetC2S(c2s);
            ProtoBufPackage pack = new ProtoBufPackage();

            pack.NProtoID = nProtoID;
            pack.Bodys    = request.Build().ToByteArray();
            return(pack);
        }
        public ProtoBufPackage buildPackage()
        {
            Trd_GetHistoryOrderFillList.Request.Builder request = Trd_GetHistoryOrderFillList.Request.CreateBuilder();
            Trd_GetHistoryOrderFillList.C2S.Builder     c2s     = Trd_GetHistoryOrderFillList.C2S.CreateBuilder();
            TrdHeader.Builder headerBuilder = TrdHeader.CreateBuilder();
            headerBuilder.TrdEnv    = (int)trdenv;
            headerBuilder.AccID     = (ulong)accID;
            headerBuilder.TrdMarket = (int)trdMarket;
            c2s.SetHeader(headerBuilder.Build());
            c2s.FilterConditions = filterConditions;

            request.SetC2S(c2s);
            ProtoBufPackage pack = new ProtoBufPackage();

            pack.NProtoID = nProtoID;
            pack.Bodys    = request.Build().ToByteArray();
            return(pack);
        }
        public ProtoBufPackage buildPackage()
        {
            Trd_PlaceOrder.Request.Builder request = Trd_PlaceOrder.Request.CreateBuilder();
            Trd_PlaceOrder.C2S.Builder     c2s     = Trd_PlaceOrder.C2S.CreateBuilder();

            ProtoBufPackage pack = new ProtoBufPackage();

            TrdHeader.Builder headerBuilder = TrdHeader.CreateBuilder();
            headerBuilder.TrdEnv    = (int)trdenv;
            headerBuilder.AccID     = (ulong)accID;
            headerBuilder.TrdMarket = (int)trdMarket;
            c2s.Header = headerBuilder.Build();

            PacketID.Builder packetID = PacketID.CreateBuilder();
            packetID.ConnID   = (ulong)connID;
            packetID.SerialNo = (uint)pack.NSerialNo;

            c2s.PacketID  = packetID.Build();
            c2s.TrdSide   = (int)trdSide;
            c2s.OrderType = (int)orderType;
            c2s.Code      = code;
            c2s.Qty       = qty;
            c2s.Price     = price;
            if (adjustPrice != null)
            {
                c2s.AdjustPrice = (bool)adjustPrice;
            }
            if (adjustSideAndLimit != null)
            {
                c2s.AdjustSideAndLimit = (double)adjustSideAndLimit;
            }


            request.SetC2S(c2s);

            pack.NProtoID = nProtoID;

            pack.Bodys = request.Build().ToByteArray();
            return(pack);
        }