Esempio n. 1
0
 internal HistoricalBidAskTick(ResponseReader r)
 {
     Time = r.ReadLong();
     TickAttribBidAsk.Set(r.ReadInt());
     PriceBid = r.ReadDouble();
     PriceAsk = r.ReadDouble();
     SizeBid  = r.ReadLong();
     SizeAsk  = r.ReadLong();
 }
Esempio n. 2
0
 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();
 }
Esempio n. 3
0
 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();
 }
Esempio n. 4
0
 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();
 }
Esempio n. 5
0
 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();
     }
 }
Esempio n. 6
0
 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();
 }
Esempio n. 7
0
 internal HistoricalTick(ResponseReader r)
 {
     Time = r.ReadLong();
     r.ReadInt(); // ?
     Price = r.ReadDouble();
     Size  = r.ReadLong();
 }
Esempio n. 8
0
 internal ReqParamsTick(ResponseReader r)
 {
     RequestId           = r.ReadInt();
     MinTick             = r.ReadDouble();
     BboExchange         = r.ReadString();
     SnapshotPermissions = r.ReadInt();
 }
Esempio n. 9
0
    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;
        }
    }
Esempio n. 10
0
    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();
        }
    }
Esempio n. 11
0
 internal PriceTick(ResponseReader r)
 {
     r.RequireVersion(3);
     RequestId  = r.ReadInt();
     TickType   = r.ReadEnum <TickType>();
     Price      = r.ReadDouble();
     Size       = r.ReadLong();
     TickAttrib = new TickAttrib(r);
 }
Esempio n. 12
0
    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));
    }
Esempio n. 13
0
    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();
        }
    }
Esempio n. 14
0
 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());
        }
    }
Esempio n. 16
0
 internal HistogramItem(ResponseReader r)
 {
     Price = r.ReadDouble();
     Size  = r.ReadLong();
 }
Esempio n. 17
0
 internal PriceIncrement(ResponseReader r)
 {
     LowEdge   = r.ReadDouble();
     Increment = r.ReadDouble();
 }