Ejemplo n.º 1
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.º 2
0
 protected TickByTick(int requestId, TickByTickType tickType, long time)
 {
     RequestId = requestId;
     TickType  = tickType;
     Time      = time;
 }