示例#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.")
        });
示例#2
0
 protected TickByTick(int requestId, TickByTickType tickType, long time)
 {
     RequestId = requestId;
     TickType  = tickType;
     Time      = time;
 }