internal MarketDepth(ResponseReader r, bool isLevel2) { r.IgnoreVersion(); RequestId = r.ReadInt(); Position = r.ReadInt(); MarketMaker = isLevel2 ? r.ReadString() : string.Empty; Operation = r.ReadEnum <MarketDepthOperation>(); Side = r.ReadEnum <MarketDepthSide>(); Price = r.ReadDouble(); Size = r.ReadLong(); if (isLevel2 && r.Builder.SupportsServerVersion(ServerVersion.SMART_DEPTH)) { IsSmartDepth = r.ReadBool(); } }
internal SizeTick(ResponseReader r) { r.IgnoreVersion(); RequestId = r.ReadInt(); TickType = r.ReadEnum <TickType>(); Size = r.ReadLong(); }
internal MarketDataTypeTick(ResponseReader r) { r.IgnoreVersion(); RequestId = r.ReadInt(); TickType = TickType.MarketDataType; MarketDataType = r.ReadEnum <MarketDataType>(); }
internal NewsBulletin(ResponseReader r) { r.IgnoreVersion(); MessageId = r.ReadInt(); Type = r.ReadEnum <NewsBulletinType>(); Message = r.ReadString(); Origin = r.ReadString(); }
internal PriceTick(ResponseReader r) { r.RequireVersion(3); RequestId = r.ReadInt(); TickType = r.ReadEnum <TickType>(); Price = r.ReadDouble(); Size = r.ReadLong(); TickAttrib = new TickAttrib(r); }
internal ExchangeForPhysicalTick(ResponseReader r) { r.IgnoreVersion(); RequestId = r.ReadInt(); TickType = r.ReadEnum <TickType>(); BasisPoints = r.ReadDouble(); FormattedBasisPoints = r.ReadString(); ImpliedFuturesPrice = r.ReadDouble(); HoldDays = r.ReadInt(); FutureLastTradeDate = r.ReadString(); DividendImpact = r.ReadDouble(); DividendsToLastTradeDate = r.ReadDouble(); }
internal static Tick Create(ResponseReader r) { r.IgnoreVersion(); int requestId = r.ReadInt(); TickType tickType = r.ReadEnum <TickType>(); double value = r.ReadDouble(); if (tickType == TickType.Halted) { return(new HaltedTick(requestId, tickType, value == 0 ? HaltType.NotHalted : HaltType.GeneralHalt)); } return(new GenericTick(requestId, tickType, value)); }
internal static TickByTick Create(ResponseReader r) { int requestId = r.ReadInt(); TickByTickType tickType = r.ReadEnum <TickByTickType>(); long time = r.ReadLong(); return(tickType switch { TickByTickType.None => None, TickByTickType.Last => new TickByTickAllLast(requestId, tickType, time, r), TickByTickType.AllLast => new TickByTickAllLast(requestId, tickType, time, r), TickByTickType.BidAsk => new TickByTickBidAsk(requestId, tickType, time, r), TickByTickType.MidPoint => new TickByTickMidpoint(requestId, tickType, time, r), _ => throw new ArgumentException("Invalid TickByTick type.") });
internal static Tick Create(ResponseReader r) { r.IgnoreVersion(); int requestId = r.ReadInt(); TickType tickType = r.ReadEnum <TickType>(); string str = r.ReadString(); if (tickType == TickType.RealtimeVolume) { return(new RealtimeVolumeTick(requestId, str)); } if (tickType == TickType.LastTimeStamp) { return(new TimeTick(requestId, str)); } return(new StringTick(requestId, tickType, str)); }
internal OptionComputationTick(ResponseReader r) { if (!r.Builder.SupportsServerVersion(ServerVersion.PRICE_BASED_VOLATILITY)) { r.RequireVersion(6); } RequestId = r.ReadInt(); TickType = r.ReadEnum <TickType>(); if (r.Builder.SupportsServerVersion(ServerVersion.PRICE_BASED_VOLATILITY)) { TickAttrib = r.ReadInt(); } ImpliedVolatility = r.ReadDoubleNullable(); if (ImpliedVolatility == -1) { ImpliedVolatility = null; } Delta = r.ReadDoubleNullable(); if (Delta == -2) { Delta = null; } OptPrice = r.ReadDoubleNullable(); if (OptPrice == -1) { OptPrice = null; } PvDividend = r.ReadDoubleNullable(); if (PvDividend == -1) { PvDividend = null; } Gamma = r.ReadDoubleNullable(); if (Gamma == -2) { Gamma = null; } Vega = r.ReadDoubleNullable(); if (Vega == -2) { Vega = null; } Theta = r.ReadDoubleNullable(); if (Theta == -2) { Theta = null; } UndPrice = r.ReadDoubleNullable(); if (UndPrice == -1) { UndPrice = null; } }
internal override void Deserialize(ResponseReader r) { base.Deserialize(r); TriggerMethod = r.ReadEnum <TriggerMethod>(); }
internal FinancialAdvisor(ResponseReader r) { r.IgnoreVersion(); DataType = r.ReadEnum <FinancialAdvisorDataType>(); Data = r.ReadString(); }
internal void ReadOrigin() => Order.Origin = R.ReadEnum <OrderOrigin>();