public async Task <decimal> MinLast20DaysAsync(string symbol) { var rootObject = await _dataProvider.FetchDataAsync(symbol, TimePeriod.InYears(1), TimePeriod.InWeeks(1)); return(rootObject.chart.result[0].indicators.quote[0].low.Where(x => x.HasValue).Select(x => x.Value).Reverse().Take(4).Min()); }
public async Task <IEnumerable <decimal> > CalculateTrAsync(string symbol) { var candles = await _dataProvider.FetchCandlesAsync(symbol, TimePeriod.InYears(5), TimePeriod.InWeeks(1)); var calculator = new TrCalculator(); return(calculator.Calculate(candles)); }