Пример #1
0
 public Message(DateTime dateTime, int type, int id, int senderId, int receiverId, ObjectTable fields) : base(dateTime)
 {
     Type = type;
     Id = id;
     SenderId = senderId;
     ReceiverId = receiverId;
     Fields = fields;
 }
Пример #2
0
 public override object Read(BinaryReader reader, byte version)
 {
     var table = new ObjectTable();
     int index;
     while ((index = reader.ReadInt32()) != -1)
         table[index] = this.streamerManager.Deserialize(reader);
     return table;
 }
Пример #3
0
 public Response(DateTime dateTime, int type, int id, int commandId, int senderId, int receiverId, ObjectTable fields) : base(dateTime, type, id, senderId, receiverId, fields)
 {
     CommandId = commandId;
 }
Пример #4
0
 public Command(DateTime dateTime, int type, int id, int senderId, int receiverId, ObjectTable fields) : base(dateTime, type, id, senderId, receiverId, fields)
 {
 }
Пример #5
0
 public ExecutionMessage(ExecutionMessage executionMessage) : base(executionMessage)
 {
     Id = executionMessage.Id;
     this.order = executionMessage.Order;
     OrderId = executionMessage.OrderId;
     ClOrderId = executionMessage.ClOrderId;
     ProviderOrderId = executionMessage.ProviderOrderId;
     this.instrument = executionMessage.Instrument;
     InstrumentId = executionMessage.InstrumentId;
     ClientId = executionMessage.ClientId;
     IsLoaded = executionMessage.IsLoaded;
     CurrencyId = executionMessage.CurrencyId;
     Fields = new ObjectTable(executionMessage.Fields);
 }
Пример #6
0
 public ExecutionCommand(ExecutionCommand command)
     : this()
 {
     Type = command.Type;
     Id = command.Id;
     ProviderId = command.ProviderId;
     RouteId = command.RouteId;
     AlgoId = command.AlgoId;
     PortfolioId = command.PortfolioId;
     InstrumentId = command.InstrumentId;
     TransactTime = command.TransactTime;
     DateTime = command.DateTime;
     Instrument = command.Instrument;
     Provider = command.Provider;
     Portfolio = command.Portfolio;
     Side = command.Side;
     OrdType = command.OrdType;
     TimeInForce = command.TimeInForce;
     ExpireTime = command.ExpireTime;
     Price = command.Price;
     StopPx = command.StopPx;
     Qty = command.Qty;
     OCA = command.OCA;
     Text = command.Text;
     Account = command.Account;
     ClientID = command.ClientID;
     Fields = new ObjectTable(command.Fields);
 }
Пример #7
0
 public ExecutionCommand(ExecutionCommandType type, Order order)
     : this()
 {
     Type = type;
     Order = order;
     OrderId = order.Id;
     ProviderId = order.ProviderId;
     RouteId = order.RouteId;
     AlgoId = order.AlgoId;
     PortfolioId = order.PortfolioId;
     InstrumentId = order.InstrumentId;
     TransactTime = order.TransactTime;
     DateTime = order.DateTime;
     Instrument = order.Instrument;
     Provider = order.Provider;
     Portfolio = order.Portfolio;
     Side = order.Side;
     OrdType = order.Type;
     TimeInForce = order.TimeInForce;
     ExpireTime = order.ExpireTime;
     Price = order.Price;
     StopPx = order.StopPx;
     Qty = order.Qty;
     MinQty = order.MinQty;
     PegDifference = order.PegDifference;
     ExecInst = order.ExecInst;
     OCA = order.OCA;
     Text = order.Text;
     Account = order.Account;
     ClientID = order.ClientID;
     Fields = new ObjectTable(order.Fields);
 }
Пример #8
0
        public override object Read(BinaryReader reader, byte version)
        {
            int id = reader.ReadInt32();
            var type = (InstrumentType)reader.ReadByte();
            var symbol = reader.ReadString();
            var description = reader.ReadString();
            var currencyId = reader.ReadByte();
            var exchange = reader.ReadString();
            var instrument = new Instrument(id, type, symbol, description, currencyId, exchange);
            instrument.TickSize = reader.ReadDouble();
            instrument.Maturity = new DateTime(reader.ReadInt64());
            instrument.Factor = reader.ReadDouble();
            instrument.Strike = reader.ReadDouble();
            instrument.PutCall = (PutCall)reader.ReadByte();
            instrument.Margin = reader.ReadDouble();

            int count = reader.ReadInt32();
            for (int i = 0; i < count; i++)
                instrument.AltId.Add((AltId)this.streamerManager.Deserialize(reader));

            count = reader.ReadInt32();
            for (int j = 0; j < count; j++)
                instrument.Legs.Add((Leg)this.streamerManager.Deserialize(reader));

            if (version == 0)
            {
                int cnt = reader.ReadInt32();
                for (int k = 0; k < cnt; k++)
                    instrument.Fields[k] = reader.ReadDouble();
            }

            if (version >= 1)
                instrument.PriceFormat = reader.ReadString();

            if (version >= 1 && version <= 4)
            {
                int size = reader.ReadInt32();
                if (size != -1)
                {
                    byte typeId = reader.ReadByte();
                    byte ver = reader.ReadByte();
                    var fields = new ObjectTable();
                    int index;
                    while ((index = reader.ReadInt32()) != -1)
                    {
                        typeId = reader.ReadByte();
                        var objectStreamer = this.streamerManager.Get(typeId);
                        fields[index] = objectStreamer.Read(reader, ver);
                    }
                    instrument.Fields = fields;
                }
            }
            if (version >= 2)
            {
                instrument.CCY1 = reader.ReadByte();
                instrument.CCY2 = reader.ReadByte();
            }

            if (version >= 3)
            {
                instrument.DeleteCached = reader.ReadBoolean();
            }

            if (version >= 4)
            {
                instrument.Formula = reader.ReadString();
            }

            if (version >= 5)
            {
                int eof = reader.ReadInt32();
                if (eof != -1)
                    instrument.Fields = (ObjectTable)this.streamerManager.Deserialize(reader);
            }
            return instrument;
        }
Пример #9
0
 public Message(DateTime dateTime, int type, int id, int senderId, int receiverId, ObjectTable fields) : base(dateTime)
 {
     Type       = type;
     Id         = id;
     SenderId   = senderId;
     ReceiverId = receiverId;
     Fields     = fields;
 }
Пример #10
0
        public override object Read(BinaryReader reader, byte version)
        {
            int id          = reader.ReadInt32();
            var type        = (InstrumentType)reader.ReadByte();
            var symbol      = reader.ReadString();
            var description = reader.ReadString();
            var currencyId  = reader.ReadByte();
            var exchange    = reader.ReadString();
            var instrument  = new Instrument(id, type, symbol, description, currencyId, exchange);

            instrument.TickSize = reader.ReadDouble();
            instrument.Maturity = new DateTime(reader.ReadInt64());
            instrument.Factor   = reader.ReadDouble();
            instrument.Strike   = reader.ReadDouble();
            instrument.PutCall  = (PutCall)reader.ReadByte();
            instrument.Margin   = reader.ReadDouble();

            int count = reader.ReadInt32();

            for (int i = 0; i < count; i++)
            {
                instrument.AltId.Add((AltId)this.streamerManager.Deserialize(reader));
            }

            count = reader.ReadInt32();
            for (int j = 0; j < count; j++)
            {
                instrument.Legs.Add((Leg)this.streamerManager.Deserialize(reader));
            }

            if (version == 0)
            {
                int cnt = reader.ReadInt32();
                for (int k = 0; k < cnt; k++)
                {
                    instrument.Fields[k] = reader.ReadDouble();
                }
            }

            if (version >= 1)
            {
                instrument.PriceFormat = reader.ReadString();
            }

            if (version >= 1 && version <= 4)
            {
                int size = reader.ReadInt32();
                if (size != -1)
                {
                    byte typeId = reader.ReadByte();
                    byte ver    = reader.ReadByte();
                    var  fields = new ObjectTable();
                    int  index;
                    while ((index = reader.ReadInt32()) != -1)
                    {
                        typeId = reader.ReadByte();
                        var objectStreamer = this.streamerManager.Get(typeId);
                        fields[index] = objectStreamer.Read(reader, ver);
                    }
                    instrument.Fields = fields;
                }
            }
            if (version >= 2)
            {
                instrument.CCY1 = reader.ReadByte();
                instrument.CCY2 = reader.ReadByte();
            }

            if (version >= 3)
            {
                instrument.DeleteCached = reader.ReadBoolean();
            }

            if (version >= 4)
            {
                instrument.Formula = reader.ReadString();
            }

            if (version >= 5)
            {
                int eof = reader.ReadInt32();
                if (eof != -1)
                {
                    instrument.Fields = (ObjectTable)this.streamerManager.Deserialize(reader);
                }
            }
            return(instrument);
        }