"Rolling" quote history resize
Hi, and thanks so much for your project.
I'm exploring the idea of "rolling" hourly candle periods that can be checked more frequently than waiting for the hourly candle to close. For example, a period from 1:23PM to 2:22PM could be a complete hourly candle, along with each hour preceding it (12:23PM to 1:22PM, 11:23-12:22PM, etc.). I'd aggregate quotes every minute as new data arrives.
Would it be possible to extend the quotes.Aggregate helper method to define a starting time that is not an even hour? Perhaps it could take the number of minutes offset from the start of the hour.
Thanks again
-Steven
It currently aggregates to the base unit, so it’d have to be a different calculation entirely, but perhaps with a different parameter on the same interface. It would repaint, for sure. Interested in giving it a try with a contribution?
Absolutely, I'll give it a shot.
I think for this one, I'd recommend creating:
public enum AggType {
Standard,
Rolling
}
And then modify the existing method API with Standard as the default (to avoid breaking change), or maybe an overload in the general form of:
public class Aggregate (
this IEnumerable<TQuote> quotes,
PeriodSize newSize,
AggType aggType = AggType.Standard) { ... }
I just noticed there's also a TimeSpan overload that would need to be updated similarly. Might need some general refactoring to sort all these variants out cleanly.