internal static void Send(ResponseComposer p) { var version = p.GetVersion(); var requestId = p.ReadInt(); if (requestId == int.MaxValue) { p.ReadDouble(); // trigger parse exception for testing } var priceTickType = p.ReadEnum <TickType>(); var price = p.ReadDouble(); var size = version >= 2 ? p.ReadInt() : 0; var priceTick = new TickPrice(requestId, priceTickType, price, new TickAttrib(version >= 3? p: null)); p.Output(priceTick); if (version >= 2) { TickType tickTypeSize = GetTickTypeSize(priceTickType); if (tickTypeSize != TickType.Undefined) { p.Output(new TickSize(requestId, tickTypeSize, size)); } } }
internal TickSize(ResponseComposer c) { c.IgnoreVersion(); RequestId = c.ReadInt(); TickType = c.ReadEnum <TickType>(); Size = c.ReadInt(); }
internal override void Deserialize(ResponseComposer reader) { base.Deserialize(reader); ConId = reader.Read <int>(); Exchange = reader.ReadString(); }
internal override void Deserialize(ResponseComposer c) { base.Deserialize(c); ConId = c.ReadInt(); Exchange = c.ReadString(); }
internal OrderStatusReport(ResponseComposer c) { var serverVersion = c.Config.ServerVersionCurrent; var version = serverVersion >= ServerVersion.MarketCapPrice ? int.MaxValue : c.ReadInt(); OrderId = c.ReadInt(); Status = c.ReadStringEnum <OrderStatus>(); Filled = c.ReadDouble(); Remaining = c.ReadDouble(); AverageFillPrice = c.ReadDouble(); if (version >= 2) { PermanentId = c.ReadInt(); } if (version >= 3) { ParentId = c.ReadInt(); } if (version >= 4) { LastFillPrice = c.ReadDouble(); } if (version >= 5) { ClientId = c.ReadInt(); } if (version >= 6) { WhyHeld = c.ReadString(); } if (serverVersion >= ServerVersion.MarketCapPrice) { MktCapPrice = c.ReadDouble(); } }
internal PortfolioValue(ResponseComposer c) { c.RequireVersion(8); Contract = new Contract { ContractId = c.ReadInt(), Symbol = c.ReadString(), SecurityType = c.ReadStringEnum <SecurityType>(), LastTradeDateOrContractMonth = c.ReadString(), Strike = c.ReadDouble(), Right = c.ReadStringEnum <RightType>(), Multiplier = c.ReadString(), PrimaryExchange = c.ReadString(), Currency = c.ReadString(), LocalSymbol = c.ReadString(), TradingClass = c.ReadString() }; Position = c.ReadDouble(); MarketPrice = c.ReadDouble(); MarketValue = c.ReadDouble(); AverageCost = c.ReadDouble(); UnrealizedPnl = c.ReadDouble(); RealizedPnl = c.ReadDouble(); Account = c.ReadString(); }
internal HistoricalTick(ResponseComposer c) { Time = c.ReadLong(); c.ReadInt(); // ? Price = c.ReadDouble(); Size = c.ReadLong(); }
internal TickMarketDataType(ResponseComposer c) { c.IgnoreVersion(); RequestId = c.ReadInt(); TickType = TickType.MarketDataType; // MarketDataType = c.ReadEnum <MarketDataType>(); }
internal TickReqParams(ResponseComposer c) { RequestId = c.ReadInt(); MinTick = c.ReadDouble(); BboExchange = c.ReadString(); SnapshotPermissions = c.ReadInt(); }
internal override void Deserialize(ResponseComposer reader) { base.Deserialize(reader); SecType = reader.ReadString(); Exchange = reader.ReadString(); Symbol = reader.ReadString(); }
internal override void Deserialize(ResponseComposer c) { base.Deserialize(c); SecType = c.ReadString(); Exchange = c.ReadString(); Symbol = c.ReadString(); }
internal AccountValue(ResponseComposer c) { c.RequireVersion(2); Key = c.ReadString(); Value = c.ReadString(); Currency = c.ReadString(); Account = c.ReadString(); }
internal NewsBulletin(ResponseComposer c) { c.IgnoreVersion(); MessageId = c.ReadInt(); Type = c.ReadEnum <NewsBulletinType>(); Message = c.ReadString(); Origin = c.ReadString(); }
public HistoricalLastTicks(ResponseComposer c) { RequestId = c.ReadInt(); var n = c.ReadInt(); Ticks = Enumerable.Repeat(new HistoricalLastTick(c), n).ToList().AsReadOnly(); Done = c.ReadBool(); }
internal HistoricalNews(ResponseComposer c) { RequestId = c.ReadInt(); Time = c.ReadString(); ProviderCode = c.ReadString(); ArticleId = c.ReadString(); Headline = c.ReadString(); }
internal MktDepthExchanges(ResponseComposer c) { var n = c.ReadInt(); for (int i = 0; i < n; i++) { Exchanges.Add(new MktDepthExchange(c)); } }
internal ScannerDataItem(ResponseComposer c) { Rank = c.ReadInt(); ContractData = new ContractData(c, ContractDataType.ScannerContractData); Distance = c.ReadString(); Benchmark = c.ReadString(); Projection = c.ReadString(); ComboLegs = c.ReadString(); }
internal FamilyCodes(ResponseComposer c) { var n = c.ReadInt(); for (int i = 0; i < n; i++) { Codes.Add(new FamilyCode(c)); } }
internal AccountSummary(ResponseComposer c) { c.IgnoreVersion(); RequestId = c.ReadInt(); Account = c.ReadString(); Tag = c.ReadString(); Value = c.ReadString(); Currency = c.ReadString(); }
internal NewsProviders(ResponseComposer c) { var n = c.ReadInt(); for (int i = 0; i < n; i++) { Providors.Add(new NewsProvider(c)); } }
internal TickNews(ResponseComposer c) { RequestId = c.ReadInt(); TimeStamp = c.ReadLong(); ProviderCode = c.ReadString(); ArticleId = c.ReadString(); Headline = c.ReadString(); ExtraData = c.ReadString(); }
internal HistoricalLastTick(ResponseComposer c) { Time = c.ReadLong(); TickAttribLast = new TickAttribLast(c.ReadInt()); Price = c.ReadDouble(); Size = c.ReadLong(); Exchange = c.ReadString(); SpecialConditions = c.ReadString(); }
internal HistoricalBidAskTick(ResponseComposer c) { Time = c.ReadLong(); TickAttribBidAsk = new TickAttribBidAsk(c.ReadInt()); PriceBid = c.ReadDouble(); PriceAsk = c.ReadDouble(); SizeBid = c.ReadLong(); SizeAsk = c.ReadLong(); }
internal MarketRule(ResponseComposer c) { MarketRuleId = c.ReadInt(); var n = c.ReadInt(); for (int i = 0; i < n; i++) { PriceIncrements.Add(new PriceIncrement(c)); } }
internal HistogramItems(ResponseComposer c) { RequestId = c.ReadInt(); var n = c.ReadInt(); for (int i = 0; i < n; i++) { Items.Add(new HistogramItem(c)); } }
internal AccountUpdateMulti(ResponseComposer c) { c.IgnoreVersion(); RequestId = c.ReadInt(); Account = c.ReadString(); ModelCode = c.ReadString(); Key = c.ReadString(); Value = c.ReadString(); Currency = c.ReadString(); }
internal SecurityDefinitionOptionParameter(ResponseComposer c) { RequestId = c.ReadInt(); Exchange = c.ReadString(); UnderlyingContractId = c.ReadInt(); TradingClass = c.ReadString(); Multiplier = c.ReadString(); c.AddStringsToList(Expirations); c.AddStringsToList(Strikes); }
internal SoftDollarTiers(ResponseComposer c) { RequestId = c.ReadInt(); var n = c.ReadInt(); for (int i = 0; i < n; i++) { Tiers.Add(new SoftDollarTier(c)); } }
internal SymbolSamples(ResponseComposer c) { RequestId = c.ReadInt(); var n = c.ReadInt(); for (int i = 0; i < n; i++) { Descriptions.Add(new ContractDescription(c)); } }
internal TickOptionComputation(ResponseComposer c) { var version = c.GetVersion(); RequestId = c.ReadInt(); TickType = c.ReadEnum <TickType>(); ImpliedVolatility = c.ReadDoubleNullable(); if (ImpliedVolatility == -1) { ImpliedVolatility = null; } Delta = c.ReadDoubleNullable(); if (Delta == -2) { Delta = null; } if (version >= 6 || TickType == TickType.ModelOptionComputation || TickType == TickType.DelayedModelOption) { OptPrice = c.ReadDoubleNullable(); if (OptPrice == -1) { OptPrice = null; } PvDividend = c.ReadDoubleNullable(); if (PvDividend == -1) { PvDividend = null; } } if (version >= 6) { Gamma = c.ReadDoubleNullable(); if (Gamma == -2) { Gamma = null; } Vega = c.ReadDoubleNullable(); if (Vega == -2) { Vega = null; } Theta = c.ReadDoubleNullable(); if (Theta == -2) { Theta = null; } UndPrice = c.ReadDoubleNullable(); if (UndPrice == -1) { UndPrice = null; } } }