QuantConnect / lean-cli

CLI for running the LEAN engine locally and in the cloud
https://www.lean.io/cli
Apache License 2.0
191 stars 100 forks source link

Fix backtest data provider configuration #403

Closed jhonabreul closed 5 months ago

jhonabreul commented 5 months ago

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: