public override void UpdateSeries() { if (candles.Count < Period) { return; } if (series.Points.Count > Period * 2) { series.Points.RemoveRange(series.Points.Count - Period * 2, Period * 2); } var movingAverage = MovingAverageCalculation.Calculate( index => candles[index].Close, series.Points.Count, candles.Count - Period, Period); series.Points.Capacity += movingAverage.Count; foreach (var t in movingAverage) { series.Points.Add(new DataPoint(series.Points.Count, t)); } SeriesUpdated?.Invoke(); }
internal void OnSeriesUpdated(DataSourceEnum source, SVR_AniDB_Anime anime) { SeriesUpdated?.Invoke(null, new SeriesInfoUpdatedEventArgs { Type = source, AnimeInfo = anime, }); }
public async void FetchSeries(int?brandId) { if (brandId is null) { return; } Series = await _seriesService?.GetSeriesAsync(brandId); SeriesUpdated?.Invoke(Series); }
internal void OnIndicatorSeriesUpdated(IndicatorSeriesUpdatedResponse message) { SeriesUpdated?.Invoke(this, new EventArgs<List<SeriesForUpdate>>(message .Series.Select(DataConverter.ToClientSeries).ToList())); }