Ejemplo n.º 1
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.º 2
0
    internal ScannerData(ResponseReader r)
    {
        r.RequireVersion(3);
        RequestId = r.ReadInt();
        int n = r.ReadInt();

        for (int i = 0; i < n; i++)
        {
            Items.Add(new ScannerDataItem(r));
        }
    }
Ejemplo n.º 3
0
    internal static Alert Create(ResponseReader r)
    {
        r.RequireVersion(2);
        int    id   = r.ReadInt();
        int    code = r.ReadInt();
        string msg  = r.ReadString();

        if (r.Builder.SupportsServerVersion(ServerVersion.ENCODE_MSG_ASCII7))
        {
            msg = Regex.Unescape(msg);
        }
        return(new Alert(id, code, msg, IsFatalCode(id, code)));
    }
Ejemplo n.º 4
0
    internal HistoricalData(ResponseReader r) // a one-shot deal
    {
        if (!r.Builder.SupportsServerVersion(ServerVersion.SYNT_REALTIME_BARS))
        {
            r.RequireVersion(3);
        }

        RequestId = r.ReadInt();
        Start     = r.ReadLocalDateTime(DateTimePattern);
        End       = r.ReadLocalDateTime(DateTimePattern);
        int n = r.ReadInt();

        for (int i = 0; i < n; i++)
        {
            Bars.Add(new HistoricalDataBar(r));
        }
    }
Ejemplo n.º 5
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;
        }
    }