예제 #1
0
 protected virtual void OnLastQuote(LastQuote LastQuote)
 {
     if (ConsolidateLevel1)
     {
         SymbolDataRec SymbolData = SymDataHandler.OnLastQuote(LastQuote);
         OnSymbolDataEvent?.Invoke(SymbolData);
     }
 }
예제 #2
0
 private void OnQuote(Quote quote)
 {
     if (ConsolidateLevel1)
     {
         SymbolDataRec SymbolData = SymDataHandler.OnQuote(quote);
         OnSymbolDataEvent?.Invoke(SymbolData);
     }
 }
예제 #3
0
 private void OnTrade(Trade trade)
 {
     if (ConsolidateLevel1)
     {
         SymbolDataRec SymbolData = SymDataHandler.OnTrade(trade);
         OnSymbolDataEvent?.Invoke(SymbolData);
     }
 }
예제 #4
0
 public void VerifySymbolDataRec(string Symbol)
 {
     lock ( SymbolDataRecs )
     {
         if (!SymbolDataRecs.Keys.Contains(Symbol))
         {
             SymbolDataRecs[Symbol] = new SymbolDataRec(Symbol);
         }
     }
 }
예제 #5
0
        public SymbolDataRec GetSymbolDataRec(string Symbol, bool Create = true)
        {
            SymbolDataRec SymbolData;

            lock ( SymbolDataRecs )
            {
                SymbolDataRecs.TryGetValue(Symbol, out SymbolData);
                if (Create && SymbolData == null)
                {
                    SymbolDataRecs[Symbol] = SymbolData = new SymbolDataRec(Symbol);
                }
            }
            return(SymbolData);
        }
예제 #6
0
        public SymbolDataRec OnLastTrade(LastTrade lastTrade)
        {
            SymbolDataRec SymbolData = GetSymbolDataRec(lastTrade.symbol);

            if (SymbolData != null)
            {
                SymbolData.Type         = SymbolDataTypes.LastTrade;
                SymbolData.LastPrice    = lastTrade.last.price;
                SymbolData.LastSize     = lastTrade.last.size;
                SymbolData.TimeStamp    = UnixTimestampMillisToESTDateTime(lastTrade.last.timestamp);
                SymbolData.UnixNanoSecs = lastTrade.last.timestamp;
            }
            return(SymbolData);
        }
예제 #7
0
        public SymbolDataRec OnTrade(Trade trade)
        {
            SymbolDataRec SymbolData = GetSymbolDataRec(trade.sym);

            if (SymbolData != null)
            {
                SymbolData.Type         = SymbolDataTypes.Trade;
                SymbolData.LastPrice    = trade.p;
                SymbolData.LastSize     = trade.s;
                SymbolData.TimeStamp    = UnixTimestampMillisToESTDateTime(trade.t);
                SymbolData.UnixNanoSecs = trade.t;
            }
            return(SymbolData);
        }
예제 #8
0
        public SymbolDataRec OnLastQuote(LastQuote LastQuote)
        {
            SymbolDataRec SymbolData = GetSymbolDataRec(LastQuote.symbol);

            if (SymbolData != null)
            {
                SymbolData.Type         = SymbolDataTypes.LastQuote;
                SymbolData.Bid          = LastQuote.last.bidprice;
                SymbolData.Ask          = LastQuote.last.askprice;
                SymbolData.AskSize      = LastQuote.last.asksize;
                SymbolData.BidSize      = LastQuote.last.bidsize;
                SymbolData.TimeStamp    = UnixTimestampMillisToESTDateTime(LastQuote.last.timestamp);
                SymbolData.UnixNanoSecs = LastQuote.last.timestamp;
            }
            return(SymbolData);
        }
예제 #9
0
        public SymbolDataRec OnQuote(Quote quote)
        {
            SymbolDataRec SymbolData = GetSymbolDataRec(quote.sym);

            if (SymbolData != null)
            {
                SymbolData.Type         = SymbolDataTypes.Quote;
                SymbolData.Bid          = quote.bp;
                SymbolData.Ask          = quote.ap;
                SymbolData.BidSize      = quote.bs;
                SymbolData.AskSize      = quote.asz;
                SymbolData.TimeStamp    = UnixTimestampMillisToESTDateTime(quote.t);
                SymbolData.UnixNanoSecs = quote.t;
            }
            return(SymbolData);
        }