Adjust lower-resolution fill-forwarded strict end-timed daily bars #8412
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adjusting lower-resolution fill-forwarded daily bars when strict end time is enable, which allows to get fill-forwarded bars with unchanged time stamps. In regular cases, like and hourly subscription or a daily subscription (without strict end times) and a minute fill forward resolution, the "intra-resolution" fill-forwarded bar times are rounded down to the actual subscription resolution.
So for instance, for an hourly resolution subscription, 59 bars will be emitted between two consecutive hours, but the start and end times are always the same, which is the start and end hour of the given range. Same happens for a daily resolution. Sor daily resolution with strict end times, this was not respected, so whithin a day, the fill forwared second, minute or hour resolution fill-forwared bars would have times increasing in the given resolution.
With this changes, the "intra-resolution" fill-forwarded bars times are respected regardless of the resolution and whether or not stritct end timing is enabled.
Algorithm.CSharp/BasicTemplateFuturesWithExtendedMarketDailyAlgorithm.cs
data point count reduction:This fixes a bug in master, were a Sunday followed by a closed Monday (holiday) would cause a bar for Sunday to be emitted, when for extended market hours FF daily bars are never emitted. These changes make sure those bars are not emitted in this case.
Test data changes:
FillForwardBars.Zip
FillForwardBars.Zip#ff_Daily_Minute.txt
Fill forward daily bars now have the same time/end times as the actual bar being fill forwarded, keeping resolution. In master this is different, since the fill forwarded bars resolution was the lowest subscribed resolution (minute in this case).
So if data has a bar for 2024/11/25 9:30am-4pm and the next bar is for 2024/11/25 9:30am-4pm, the fill-forwarded bars for 2024/11/26 will all have the same time stamps (2024/11/25 9:30am-4pm) until market close, where a new FF bar will be emitted for 2024/11/26 9:30am-4pm, which will be FF until 2024/11/27 4pm.
The same applies for FillForwardStrictEndTimeMinuteRegressionAlgorithm.zip and FillForwardStrictEndTimeHourRegressionAlgorithm.zip:
Related Issue
Closes #8392
Motivation and Context
Requires Documentation Change
How Has This Been Tested?
Regression algorithm and existing algorithms
Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>