コード例 #1
0
        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();
            }
        }
コード例 #2
0
ファイル: Ticks.cs プロジェクト: Timezone-design/InterReact
        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));
                }
            }
        }
コード例 #3
0
ファイル: Ticks.cs プロジェクト: Timezone-design/InterReact
 internal TickSize(ResponseComposer c)
 {
     c.IgnoreVersion();
     RequestId = c.ReadInt();
     TickType  = c.ReadEnum <TickType>();
     Size      = c.ReadInt();
 }
コード例 #4
0
 internal TickReqParams(ResponseComposer c)
 {
     RequestId           = c.ReadInt();
     MinTick             = c.ReadDouble();
     BboExchange         = c.ReadString();
     SnapshotPermissions = c.ReadInt();
 }
コード例 #5
0
        public HistoricalLastTicks(ResponseComposer c)
        {
            RequestId = c.ReadInt();
            var n = c.ReadInt();

            Ticks = Enumerable.Repeat(new HistoricalLastTick(c), n).ToList().AsReadOnly();
            Done  = c.ReadBool();
        }
 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);
 }
コード例 #7
0
        internal HistogramItems(ResponseComposer c)
        {
            RequestId = c.ReadInt();
            var n = c.ReadInt();

            for (int i = 0; i < n; i++)
            {
                Items.Add(new HistogramItem(c));
            }
        }
コード例 #8
0
        internal SoftDollarTiers(ResponseComposer c)
        {
            RequestId = c.ReadInt();
            var n = c.ReadInt();

            for (int i = 0; i < n; i++)
            {
                Tiers.Add(new SoftDollarTier(c));
            }
        }
コード例 #9
0
        internal MarketRule(ResponseComposer c)
        {
            MarketRuleId = c.ReadInt();
            var n = c.ReadInt();

            for (int i = 0; i < n; i++)
            {
                PriceIncrements.Add(new PriceIncrement(c));
            }
        }
コード例 #10
0
        internal SymbolSamples(ResponseComposer c)
        {
            RequestId = c.ReadInt();
            var n = c.ReadInt();

            for (int i = 0; i < n; i++)
            {
                Descriptions.Add(new ContractDescription(c));
            }
        }
コード例 #11
0
        internal ScannerData(ResponseComposer c)
        {
            c.RequireVersion(3);
            RequestId = c.ReadInt();
            var n = c.ReadInt();

            for (int i = 0; i < n; i++)
            {
                Items.Add(new ScannerDataItem(c));
            }
        }
コード例 #12
0
 internal DeltaNeutralContract(ResponseComposer c, bool independent)
 {
     if (independent)
     {
         c.IgnoreVersion();
         RequestId = c.ReadInt();
     }
     ContractId = c.ReadInt();
     Delta      = c.ReadDouble();
     Price      = c.ReadDouble();
 }
コード例 #13
0
        public HistoricalTicks(ResponseComposer c)
        {
            RequestId = c.ReadInt();
            var n = c.ReadInt();

            for (int i = 0; i < n; i++)
            {
                Ticks.Add(new HistoricalTick(c));
            }
            Done = c.ReadBool();
        }
コード例 #14
0
 internal ContractComboLeg(ResponseComposer c)
 {
     ContractId         = c.ReadInt();
     Ratio              = c.ReadInt();
     TradeAction        = c.ReadStringEnum <TradeAction>();
     Exchange           = c.ReadString();
     OpenClose          = c.ReadEnum <ComboOpenClose>();
     ComboShortSaleSlot = c.ReadEnum <ComboShortSaleSlot>();
     DesignatedLocation = c.ReadString();
     ExemptCode         = c.ReadInt();
 }
コード例 #15
0
 internal HistoricalData(ResponseComposer c)
 {
     RequestId = c.ReadInt();
     BarCount  = c.ReadInt();
     Date      = c.ReadString();
     Open      = c.ReadDouble();
     Close     = c.ReadDouble();
     High      = c.ReadDouble();
     Low       = c.ReadDouble();
     WAP       = c.ReadDouble();
     Volume    = c.ReadLong();
 }
コード例 #16
0
        internal SmartComponents(ResponseComposer c)
        {
            RequestId = c.ReadInt();
            var n = c.ReadInt();

            for (var i = 0; i < n; i++)
            {
                var bitNumber      = c.ReadInt();
                var exchange       = c.ReadString();
                var exchangeLetter = c.ReadChar();
                Map.Add(bitNumber, new KeyValuePair <string, char>(exchange, exchangeLetter));
            }
        }
コード例 #17
0
ファイル: Ticks.cs プロジェクト: Timezone-design/InterReact
 internal TickExchangeForPhysical(ResponseComposer c)
 {
     c.IgnoreVersion();
     RequestId                = c.ReadInt();
     TickType                 = c.ReadEnum <TickType>();
     BasisPoints              = c.ReadDouble();
     FormattedBasisPoints     = c.ReadString();
     ImpliedFuturesPrice      = c.ReadDouble();
     HoldDays                 = c.ReadInt();
     FutureExpiry             = c.ReadString();
     DividendImpact           = c.ReadDouble();
     DividendsToLastTradeDate = c.ReadDouble();
 }
コード例 #18
0
 internal RealtimeBar(ResponseComposer c)
 {
     c.IgnoreVersion();
     RequestId = c.ReadInt();
     Time      = Instant.FromUnixTimeSeconds(long.Parse(c.ReadString(), NumberFormatInfo.InvariantInfo));
     Open      = c.ReadDouble();
     High      = c.ReadDouble();
     Low       = c.ReadDouble();
     Close     = c.ReadDouble();
     Volume    = c.ReadLong();
     Wap       = c.ReadDouble();
     Count     = c.ReadInt();
 }
コード例 #19
0
 internal MarketDepth(ResponseComposer c, bool isLevel2)
 {
     c.IgnoreVersion();
     RequestId   = c.ReadInt();
     Position    = c.ReadInt();
     MarketMaker = isLevel2 ? c.ReadString() : string.Empty;
     Operation   = c.ReadEnum <MarketDepthOperation>();
     Side        = c.ReadEnum <MarketDepthSide>();
     Price       = c.ReadDouble();
     Size        = c.ReadInt();
     if (isLevel2 && c.Config.SupportsServerVersion(ServerVersion.SmartDepth))
     {
         IsSmartDepth = c.ReadBool();
     }
 }
コード例 #20
0
 public PnLSingle(ResponseComposer c)
 {
     RequestId = c.ReadInt();
     Pos       = c.ReadInt();
     DailyPnL  = c.ReadDouble();
     if (c.Config.SupportsServerVersion(ServerVersion.UnrealizedPnl))
     {
         UnrealizedPnL = c.ReadDouble();
     }
     if (c.Config.SupportsServerVersion(ServerVersion.RealizedPnl))
     {
         RealizedPnL = c.ReadDouble();
     }
     Value = c.ReadDouble();
 }
コード例 #21
0
        internal HistoricalBars(ResponseComposer c) // a one-shot deal
        {
            if (!c.Config.SupportsServerVersion(ServerVersion.SyntRealtimeBats))
            {
                c.RequireVersion(3);
            }
            RequestId = c.ReadInt();
            Start     = c.ReadLocalDateTime(DateTimePattern);
            End       = c.ReadLocalDateTime(DateTimePattern);
            var n = c.ReadInt();

            for (var i = 0; i < n; i++)
            {
                Bars.Add(new HistoricalBar(c));
            }
        }
コード例 #22
0
 internal HistoricalTick(ResponseComposer c)
 {
     Time = c.ReadLong();
     c.ReadInt(); // ?
     Price = c.ReadDouble();
     Size  = c.ReadLong();
 }
コード例 #23
0
        internal override void Deserialize(ResponseComposer c)
        {
            base.Deserialize(c);

            ConId    = c.ReadInt();
            Exchange = c.ReadString();
        }
コード例 #24
0
 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();
 }
コード例 #25
0
ファイル: Ticks.cs プロジェクト: Timezone-design/InterReact
 internal TickMarketDataType(ResponseComposer c)
 {
     c.IgnoreVersion();
     RequestId      = c.ReadInt();
     TickType       = TickType.MarketDataType; //
     MarketDataType = c.ReadEnum <MarketDataType>();
 }
コード例 #26
0
 internal NewsBulletin(ResponseComposer c)
 {
     c.IgnoreVersion();
     MessageId = c.ReadInt();
     Type      = c.ReadEnum <NewsBulletinType>();
     Message   = c.ReadString();
     Origin    = c.ReadString();
 }
コード例 #27
0
 internal HistoricalNews(ResponseComposer c)
 {
     RequestId    = c.ReadInt();
     Time         = c.ReadString();
     ProviderCode = c.ReadString();
     ArticleId    = c.ReadString();
     Headline     = c.ReadString();
 }
コード例 #28
0
 internal TickNews(ResponseComposer c)
 {
     RequestId    = c.ReadInt();
     TimeStamp    = c.ReadLong();
     ProviderCode = c.ReadString();
     ArticleId    = c.ReadString();
     Headline     = c.ReadString();
     ExtraData    = c.ReadString();
 }
コード例 #29
0
 internal HistoricalLastTick(ResponseComposer c)
 {
     Time              = c.ReadLong();
     TickAttribLast    = new TickAttribLast(c.ReadInt());
     Price             = c.ReadDouble();
     Size              = c.ReadLong();
     Exchange          = c.ReadString();
     SpecialConditions = c.ReadString();
 }
コード例 #30
0
 internal HistoricalBidAskTick(ResponseComposer c)
 {
     Time             = c.ReadLong();
     TickAttribBidAsk = new TickAttribBidAsk(c.ReadInt());
     PriceBid         = c.ReadDouble();
     PriceAsk         = c.ReadDouble();
     SizeBid          = c.ReadLong();
     SizeAsk          = c.ReadLong();
 }