ArgumentOutOfRangeException for Aggregation with PeriodSize.Month
See original GitHub issuethe problem
Calling public static IEnumerable<Quote> Aggregate<TQuote>(this IEnumerable<TQuote> quotes, PeriodSize newSize)
with PeriodSize.Month
returns a ArgumentOutOfRangeException
. Aggregation by other periods in lower time frame (Daily, Weekly) works as expected.
to reproduce
- Create a
IEnumerable<Quote> quotes
collection with hourly or daily data - Call
quotes.Aggregate(PeriodSize.Month)
Error message(s):
System.ArgumentOutOfRangeException
HResult=0x80131502
Message=Historical quotes Aggregation must use a new size value that is greater than zero (0). Arg_ParamName_Name
ArgumentOutOfRange_ActualValue
Source=Skender.Stock.Indicators
StackTrace:
at Skender.Stock.Indicators.HistoricalQuotes.Aggregate[TQuote](IEnumerable`1 quotes, TimeSpan timeSpan)
at Skender.Stock.Indicators.HistoricalQuotes.Aggregate[TQuote](IEnumerable`1 quotes, PeriodSize newSize)
Issue Analytics
- State:
- Created 2 years ago
- Comments:7 (4 by maintainers)
Top Results From Across the Web
Year, Month, and Day parameters describe an un- ...
ArgumentOutOfRangeException : Year, Month, and Day parameters describe an un-representable DateTime. DateTime fromDate = new DateTime(DateTime.
Read more >ArgumentOutOfRangeException Class (System)
The exception that is thrown when the value of an argument is outside the allowable range of values as defined by the invoked...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
The
PeriodSize
enum value is converted to aTimeSpan
object with an extension method:This extension method is lacking a case for PeriodSize.Month:
This was implemented in version 1.22.0 and is now available.