internal HistoricalBidAskTick(ResponseReader r) { Time = r.ReadLong(); TickAttribBidAsk.Set(r.ReadInt()); PriceBid = r.ReadDouble(); PriceAsk = r.ReadDouble(); SizeBid = r.ReadLong(); SizeAsk = r.ReadLong(); }
internal HistoricalDataUpdate(ResponseReader r) { RequestId = r.ReadInt(); BarCount = r.ReadInt(); Date = r.ReadString(); Open = r.ReadDouble(); Close = r.ReadDouble(); High = r.ReadDouble(); Low = r.ReadDouble(); WAP = r.ReadDouble(); Volume = r.ReadLong(); }
internal RealtimeBar(ResponseReader r) { r.IgnoreVersion(); RequestId = r.ReadInt(); Time = Instant.FromUnixTimeSeconds(long.Parse(r.ReadString(), NumberFormatInfo.InvariantInfo)); Open = r.ReadDouble(); High = r.ReadDouble(); Low = r.ReadDouble(); Close = r.ReadDouble(); Volume = r.ReadLong(); Wap = r.ReadDouble(); Count = r.ReadInt(); }
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 PnL(ResponseReader r) { RequestId = r.ReadInt(); DailyPnL = r.ReadDouble(); if (r.Builder.SupportsServerVersion(ServerVersion.UNREALIZED_PNL)) { UnrealizedPnL = r.ReadDouble(); } if (r.Builder.SupportsServerVersion(ServerVersion.REALIZED_PNL)) { RealizedPnL = r.ReadDouble(); } }
internal HistoricalDataBar(ResponseReader r) { Date = r.ReadLocalDateTime(HistoricalData.DateTimePattern); Open = r.ReadDouble(); High = r.ReadDouble(); Low = r.ReadDouble(); Close = r.ReadDouble(); Volume = r.ReadLong(); WeightedAveragePrice = r.ReadDouble(); if (!r.Builder.SupportsServerVersion(ServerVersion.SYNT_REALTIME_BARS)) { r.ReadString(); /*string hasGaps = */ } Count = r.ReadInt(); }
internal HistoricalTick(ResponseReader r) { Time = r.ReadLong(); r.ReadInt(); // ? Price = r.ReadDouble(); Size = r.ReadLong(); }
internal ReqParamsTick(ResponseReader r) { RequestId = r.ReadInt(); MinTick = r.ReadDouble(); BboExchange = r.ReadString(); SnapshotPermissions = r.ReadInt(); }
internal CommissionReport(ResponseReader r) { r.IgnoreVersion(); ExecutionId = r.ReadString(); Commission = r.ReadDouble(); Currency = r.ReadString(); RealizedPnl = r.ReadDouble(); Yield = r.ReadDouble(); YieldRedemptionDate = r.ReadInt(); if (Execution.Executions.TryGetValue(ExecutionId, out Execution? execution)) { Execution = execution; OrderId = execution.OrderId; RequestId = execution.RequestId; } }
public void ReadContract() { if (MessageVersion >= 17) { Contract.ContractId = R.ReadInt(); } Contract.Symbol = R.ReadString(); Contract.SecurityType = R.ReadStringEnum <SecurityType>(); Contract.LastTradeDateOrContractMonth = R.ReadString(); Contract.Strike = R.ReadDouble(); Contract.Right = R.ReadStringEnum <OptionRightType>(); if (MessageVersion >= 32) { Contract.Multiplier = R.ReadString(); } Contract.Exchange = R.ReadString(); Contract.Currency = R.ReadString(); if (MessageVersion >= 2) { Contract.LocalSymbol = R.ReadString(); } if (MessageVersion >= 32) { Contract.TradingClass = 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 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 OrderStatusReport(ResponseReader r) { if (!r.Builder.SupportsServerVersion(ServerVersion.MARKET_CAP_PRICE)) { r.IgnoreVersion(); } OrderId = r.ReadInt(); Status = r.ReadStringEnum <OrderStatus>(); Filled = r.ReadDouble(); Remaining = r.ReadDouble(); AverageFillPrice = r.ReadDouble(); PermanentId = r.ReadInt(); ParentId = r.ReadInt(); LastFillPrice = r.ReadDouble(); ClientId = r.ReadInt(); WhyHeld = r.ReadString(); if (r.Builder.SupportsServerVersion(ServerVersion.MARKET_CAP_PRICE)) { MktCapPrice = r.ReadDouble(); } }
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 SecurityDefinitionOptionParameter(ResponseReader r) { RequestId = r.ReadInt(); Exchange = r.ReadString(); UnderlyingContractId = r.ReadInt(); TradingClass = r.ReadString(); Multiplier = r.ReadString(); int n = r.ReadInt(); for (int i = 0; i < n; i++) { Expirations.Add(r.ReadString()); } n = r.ReadInt(); for (int i = 0; i < n; i++) { Strikes.Add(r.ReadDouble()); } }
internal HistogramItem(ResponseReader r) { Price = r.ReadDouble(); Size = r.ReadLong(); }
internal PriceIncrement(ResponseReader r) { LowEdge = r.ReadDouble(); Increment = r.ReadDouble(); }