public static void ProcessQuotation(Quotation quotation, int volume) { CandleBuilder builder; if (!builders.TryGetValue(quotation.InstrumentID, out builder)) { builder = new CandleBuilder(CandleDAL.GetLast(quotation.InstrumentID), CandleType.Minute); builders.Add(quotation.InstrumentID, builder); } builder.ProcessQuotation(quotation, volume); DataSaver.AddCandle(builder.LastData); }
private async void GetCandles() { this.builder = null; var candles = await Task.Run(() => { return CandleCenter.GetCandles(this.instrumentID, this.CandleType, this.From); }); this.Candles = new ObservableCollection<Candle>(candles); this.builder = new CandleBuilder(this.Candles.LastOrDefault(), this.CandleType); }