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

Make Target.MoveAhead() case insensitive #8382

Conversation

Marinovsky
Copy link
Collaborator

Description

Some months ago we did a refactor to put in camel case format the json backtest results (see d40ec77#diff-61ef02f06dedc5d14baa64cdc98d1341bd9b991ca4c6fef3f7b42743d31819bd). However, we forgot to update the references in lean-cli/lean/components/util/optimization_configurer.py
image
as well as those in QuantConnect.Optimizer.Launcher/config.example.json
image
Thus, when running an optimization, the optimization result was always null since no match between the optimization target and the json backtest results was found:
image
For this reason, I modified the Target.MoveAhead() method to be case insensitive, so that we didn't need to change the other aforementioned files.

Related Issue

Closes lean-cli#507 (QuantConnect/lean-cli#507)

Motivation and Context

With this change, users will be able to run optimizations using lean-cli

Requires Documentation Change

N/A

How Has This Been Tested?

The method Target.MoveAhead() relies on the private static method Target.GetTokenInJsonBacktest() to be case insensitive. Thus I created a unit test with different target test cases (some in capital case others in camel case) and asserted the static method returned the expected value (that could be null) for all of them.

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>

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 👍

@Martin-Molinero Martin-Molinero merged commit d5b2e4d into QuantConnect:master Oct 24, 2024
7 checks passed
wtindall1 pushed a commit to wtindall1/Lean that referenced this pull request Nov 10, 2024
* First draft of the solution

* Try a different approach

* Nit change

* Add unit tests

* Add edge cases

* Address requests
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.

2 participants