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

Fix backtest data provider configuration #403

Merged

Conversation

jhonabreul
Copy link
Collaborator

@jhonabreul jhonabreul commented Jan 24, 2024

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 but LeanConfigConfigurer._configure_environment was not able to handle that type of configuration.

Two things were done:

  1. 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.
  2. LeanConfigConfigurer._configure_environment can just skip data providers instead of raising an exception.

Closes #401

Tested locally with the following:

  • Interactive Live Deploy.
  • Non Interactive Live Deploy.
  • Non Interactive Live Deploy using --environment option:
    • Having different environments in 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.
  • Backtesting and research specifing the data provider to use.

An exception was being raised when configuring the data provider from the json modules
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 👍

@jhonabreul jhonabreul merged commit b5979a3 into QuantConnect:master Jan 24, 2024
23 checks passed
@jhonabreul jhonabreul deleted the bug-401-data-provider-environment branch January 24, 2024 18:49
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.

DataProvider not valid for _configure_environment() in Lean v1.0.178
2 participants