Ejemplo n.º 1
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();
     }
 }
Ejemplo n.º 2
0
 internal SizeTick(ResponseReader r)
 {
     r.IgnoreVersion();
     RequestId = r.ReadInt();
     TickType  = r.ReadEnum <TickType>();
     Size      = r.ReadLong();
 }
Ejemplo n.º 3
0
 internal MarketDataTypeTick(ResponseReader r)
 {
     r.IgnoreVersion();
     RequestId      = r.ReadInt();
     TickType       = TickType.MarketDataType;
     MarketDataType = r.ReadEnum <MarketDataType>();
 }
Ejemplo n.º 4
0
 internal NewsBulletin(ResponseReader r)
 {
     r.IgnoreVersion();
     MessageId = r.ReadInt();
     Type      = r.ReadEnum <NewsBulletinType>();
     Message   = r.ReadString();
     Origin    = r.ReadString();
 }
Ejemplo n.º 5
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);
 }
Ejemplo n.º 6
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();
 }
Ejemplo n.º 7
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));
    }
Ejemplo n.º 8
0
    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.")
        });
Ejemplo n.º 9
0
    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));
    }
Ejemplo n.º 10
0
    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;
        }
    }
Ejemplo n.º 11
0
 internal override void Deserialize(ResponseReader r)
 {
     base.Deserialize(r);
     TriggerMethod = r.ReadEnum <TriggerMethod>();
 }
Ejemplo n.º 12
0
 internal FinancialAdvisor(ResponseReader r)
 {
     r.IgnoreVersion();
     DataType = r.ReadEnum <FinancialAdvisorDataType>();
     Data     = r.ReadString();
 }
Ejemplo n.º 13
0
 internal void ReadOrigin() => Order.Origin = R.ReadEnum <OrderOrigin>();