Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Benchmark data mixed normalization mode fix #8012

Conversation

jhonabreul
Copy link
Collaborator

@jhonabreul jhonabreul commented May 9, 2024

Description

Skip the security security initializer for benchmark securities, avoiding the user defined ones (if set).

A user defined security initializer might use a security seeder or set the security market price with historical data and:

  • If the benchmark security has not been added to the algorithm, there won't be a subscription data config to use for the historical data request.
  • In this case, the universe settings will be used to make a subscription data config for the request, and if the user sets the data normalization mode to != Adjusted (which is used for benchmark securities) and the data will be mixed with initial Raw values (for example) and then the normal adjusted ones.

We avoid this by not initializing the benchmark security, since it does not need it

Regression algorithms AlgorithmHistoryDataPoints decrease:

These algorithms use user defined security initializers that set the security market price with historical data. These history requests are skipped for benchmark securities, hence the decrease.

Related Issue

Close #7846

Motivation and Context

Requires Documentation Change

How Has This Been Tested?

Unit test and regression algorithms

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • Refactor (non-breaking change which improves implementation)
  • Performance (non-breaking change which improves performance. Please add associated performance test and results)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Non-functional change (xml comments/documentation/etc)

Checklist:

  • My code follows the code style of this project.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.
  • My branch follows the naming convention bug-<issue#>-<description> or feature-<issue#>-<description>

@jhonabreul jhonabreul force-pushed the bug-7846-benchmark-data-normalization-mode branch from fc05d4f to 29c7029 Compare May 9, 2024 21:27
Copy link
Member

@Martin-Molinero Martin-Molinero left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! 👍

@jhonabreul jhonabreul merged commit 7e7fd4d into QuantConnect:master May 9, 2024
7 checks passed
@jhonabreul jhonabreul deleted the bug-7846-benchmark-data-normalization-mode branch May 9, 2024 22:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Benchmark Receives Raw Data
2 participants