Lean icon indicating copy to clipboard operation
Lean copied to clipboard

Remove duplicated keys in OpenInterestFutureUniverseSelectionModel

Open Marinovsky opened this issue 1 year ago • 0 comments

Description

There are two open interest files from 6E Future at daily (and minute resolution) that maps to the same symbol in OpenInterestFutureUniverseSelectionModel, thus the method OpenInterestFutureUniverseSelectionModel.Filter() throws an exception when found this duplicated symbol. I added a LINQ method to remove those duplicated entries before creating a dictionary for the OpenInterestFutureUniverseSelectionModel.FilterByOpenInterest() method.

Related Issue

Closes #8354

Motivation and Context

With this change, user's algorithms won't throw an exception when using 6E Future with OpenInterestFutureUniverseSelectionModel

Requires Documentation Change

N/A

How Has This Been Tested?

I reproduced the bug locally using the algo provided in the GH issue and asserted it didn't fail after the changes.

Types of changes

  • [x] 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:

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

Marinovsky avatar Oct 08 '24 18:10 Marinovsky