예제 #1
0
        internal static QuantBoxOrderInfo GetOrderInfo(Order order)
        {
            var data = (QuantBoxOrderInfo)order.Fields[QuantBoxConst.OrderInfoOffset];

            if (data == null)
            {
                data = new QuantBoxOrderInfo();
                order.Fields[QuantBoxConst.OrderInfoOffset] = data;
            }
            return(data);
        }
예제 #2
0
        private static QuantBoxOrderInfo GetOrderInfo(Order order)
        {
            var data = (QuantBoxOrderInfo)order.Fields[QuantBoxConst.InstrumentMarketDataOffset];

            if (data == null)
            {
                data = new QuantBoxOrderInfo();
                order.Fields[QuantBoxConst.InstrumentMarketDataOffset] = data;
            }
            return(data);
        }
        private void ReadTable(BsonDocument doc, ExecutionMessage msg)
        {
            if (doc.TryGetValue("orderInfo", out var v))
            {
                var data = v.AsBinary;
                var info = new QuantBoxOrderInfo();
                info.Load(data);
                msg.Fields[QuantBoxConst.OrderInfoOffset] = info;
            }

            if (doc.TryGetValue("fields", out var f) && !f.IsNull)
            {
                var buffer = f.AsBinary;
                using (var stream = new MemoryStream(buffer))
                    using (var reader = new BinaryReader(stream)) {
                        _fieldsReader(ObjectTableOwner.Order, msg.Fields, reader);
                    }
            }
        }