Exemplo n.º 1
0
		public override object Read(BinaryReader reader)
		{
			reader.ReadByte();
			int id = reader.ReadInt32();
			InstrumentType type = (InstrumentType)reader.ReadByte();
			string symbol = reader.ReadString();
			string description = reader.ReadString();
			byte currencyId = reader.ReadByte();
			string exchange = reader.ReadString();
			Instrument 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 num = reader.ReadInt32();
			for (int i = 0; i < num; i++)
			{
				AltId altId = new AltId();
				altId.providerId = reader.ReadByte();
				altId.symbol = reader.ReadString();
				altId.exchange = reader.ReadString();
				instrument.altId.Add(altId);
			}
			return instrument;
		}
Exemplo n.º 2
0
        public override object Read(BinaryReader reader)
        {
            reader.ReadByte();
            int            id          = reader.ReadInt32();
            InstrumentType type        = (InstrumentType)reader.ReadByte();
            string         symbol      = reader.ReadString();
            string         description = reader.ReadString();
            byte           currencyId  = reader.ReadByte();
            string         exchange    = reader.ReadString();
            Instrument     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 num = reader.ReadInt32();

            for (int i = 0; i < num; i++)
            {
                AltId altId = new AltId();
                altId.providerId = reader.ReadByte();
                altId.symbol     = reader.ReadString();
                altId.exchange   = reader.ReadString();
                instrument.altId.Add(altId);
            }
            return(instrument);
        }
Exemplo n.º 3
0
        public string GetExchange(byte providerId)
        {
            AltId altId = this.altId.Get(providerId);

            if (altId != null && !string.IsNullOrEmpty(altId.exchange))
            {
                return(altId.exchange);
            }
            return(this.exchange);
        }
Exemplo n.º 4
0
        public string GetSymbol(byte providerId)
        {
            AltId altId = this.altId.Get(providerId);

            if (altId != null && !string.IsNullOrEmpty(altId.symbol))
            {
                return(altId.symbol);
            }
            return(this.symbol);
        }