Fix backtest data provider configuration #403
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.
An exception was being raised when configuring the data provider from the JSON modules. This was happening when a data provider was specified for the
backtest
command using the--data-provider
option.When the data provider environment is being configured from the JSON modules, the data provider configuration is picked up by
JsonModule.get_configurations_env_values_from_name
butLeanConfigConfigurer._configure_environment
was not able to handle that type of configuration.Two things were done:
JsonModule.get_configurations_env_values_from_name
just gets the available environment from the JSON module configurations, which is always one and does not depend on a name.LeanConfigConfigurer._configure_environment
can just skip data providers instead of raising an exception.Closes #401
Tested locally with the following:
--environment
option:lean.json
to make sure each one is used. For instance having "live-interactive" to deploy to IB and "live-interactive-polygon" (with Polygon as data queue handler and history provider) to deploy to IB using Polygon as data feed.