Make Target.MoveAhead()
case insensitive
#8382
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
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
as well as those in
QuantConnect.Optimizer.Launcher/config.example.json
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:
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 methodTarget.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
Checklist:
bug-<issue#>-<description>
orfeature-<issue#>-<description>