Security initialization on re-addition #8681
Merged
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
Ensure securities are initialized every time they are added or re-added, including scenarios like manual removal and re-addition and deselection and re-selection by universes, like options or custom universes.
Also make sure initialization happens only once for each security on addition.
Performance tests:
Since now the securities are being initialized every time they are re-added (either manually or by being selected by a universe), we expect to have minor performance impacts on algorithms that are doing selection.
Daily coarse selection: 50 top equities by dollar volume and their options:
Master: ~136s on avg
PR: ~146s on avg (~7% slower)
Daily coarse selection: randomly selecting 50 out 200 top equities by dollar volume and their options:
Note: selecting 50 randomly so we force some equities are de-selected and re-selected each day, which forces more security initializations.
Master: ~166s on avg
PR: ~191s on avg (~7% slower)
Related Issue
Part of #7929
Motivation and Context
Requires Documentation Change
How Has This Been Tested?
Regression algorithms
Types of changes
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>