Beispiel #1
0
        public void OnQuoteUpdated(QuoteItem quoteItem)
        {
            if (Pause)
            {
                return;
            }

            // insert at header
            _recentQuotes.Insert(0, quoteItem);

            if (_recentQuotes.Count > HistorySize)
            {
                // remove from tailer
                _recentQuotes.RemoveAt(HistorySize);
            }
        }
Beispiel #2
0
        public static QuoteItem ToBindableQuote(QuoteData quoteData)
        {
            QuoteItem item = new QuoteItem();

            item.Last = quoteData.dLast;
            item.Ask  = quoteData.dAsk;
            item.Bid  = quoteData.dBid;

            DateTime time;
            bool     succ = DateTime.TryParse(quoteData.caUpdateTime, out time);

            if (succ)
            {
                item.UpdateTime = time;
            }

            return(item);
        }