Esempio n. 1
0
        public FeedTick ToFeedTick(Quote quote)
        {
            this.records.Clear();

            this.FillRecords(FxPriceType.Bid, quote.Bids);
            this.FillRecords(FxPriceType.Ask, quote.Asks);

            if (!string.IsNullOrEmpty(quote.Id))
            {
                var id = FeedTickId.Parse(quote.Id);
                this.index = id.Index;
            }
            else if (this.lastUsedTimeStamp < quote.CreatingTime)
            {
                this.index = 0;
            }
            this.lastUsedTimeStamp = quote.CreatingTime;
            var result = new FeedTick(quote.Symbol, quote.CreatingTime, this.index, this.records);

            ++this.index;
            return(result);
        }
Esempio n. 2
0
        public FeedTick ToFeedTick(Quote quote)
		{
			this.records.Clear();

			this.FillRecords(FxPriceType.Bid, quote.Bids);
			this.FillRecords(FxPriceType.Ask, quote.Asks);

			if (!string.IsNullOrEmpty(quote.Id))
			{
				var id = FeedTickId.Parse(quote.Id);
				this.index = id.Index;
			}
			else if (this.lastUsedTimeStamp < quote.CreatingTime)
			{
				this.index = 0;
			}
			this.lastUsedTimeStamp = quote.CreatingTime;
			var result = new FeedTick(quote.Symbol, quote.CreatingTime, this.index, this.records);
			++this.index;
			return result;
		}