public double Min(MonthlyTimeSeriesApiModel monthlyTimeSeries, DateTime from, DateTime to) { return(Filter(monthlyTimeSeries, from, to).Min(m => m.Low));; }
private List <MonthlyQuoteApiModel> Filter(MonthlyTimeSeriesApiModel monthlyTimeSeries, DateTime from, DateTime to) { return(monthlyTimeSeries.MonthlyTimeSeries .Where(m => DateTime.Parse(m.Key) >= from && DateTime.Parse(m.Key) <= to) .Select(m => m.Value).ToList()); }
public double Avg(MonthlyTimeSeriesApiModel monthlyTimeSeries, DateTime from, DateTime to) { return(Filter(monthlyTimeSeries, from, to).Average(m => m.Close)); }