Skip to content

Commit d1034be

Browse files
authored
Rename: several command (#416)
* rename: data-provider and data-feed * rename: data-provider in tests * typo: change words order feat: add missed words in help of historical-provider param * feat: update README
1 parent bab821e commit d1034be

File tree

15 files changed

+89
-89
lines changed

15 files changed

+89
-89
lines changed

README.md

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,8 @@ Options:
143143
-d, --detach Run the backtest in a detached Docker container and return immediately
144144
--debug [pycharm|ptvsd|vsdbg|rider|local-platform]
145145
Enable a certain debugging method (see --help for more information)
146-
--data-provider [IQFeed|Polygon|IEX|AlphaVantage|QuantConnect|Local|Terminal Link]
147-
Update the Lean configuration file to retrieve data from the given provider
146+
--data-provider-historical [IQFeed|Polygon|IEX|AlphaVantage|QuantConnect|Local|Terminal Link]
147+
Update the Lean configuration file to retrieve data from the given historical provider
148148
--iqfeed-iqconnect TEXT The path to the IQConnect binary
149149
--iqfeed-username TEXT Your IQFeed username
150150
--iqfeed-password TEXT Your IQFeed password
@@ -170,9 +170,9 @@ Options:
170170
--terminal-link-openfigi-api-key TEXT
171171
The Open FIGI API key to use for mapping options
172172
--download-data Update the Lean configuration file to download data from the QuantConnect API, alias
173-
for --data-provider QuantConnect
173+
for --data-provider-historical QuantConnect
174174
--data-purchase-limit INTEGER The maximum amount of QCC to spend on downloading data during the backtest when using
175-
QuantConnect as data provider
175+
QuantConnect as historical data provider
176176
--release Compile C# projects in release configuration instead of debug
177177
--image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)
178178
--python-venv TEXT The path of the python virtual environment to be used
@@ -1043,15 +1043,15 @@ Usage: lean live deploy [OPTIONS] PROJECT
10431043
If PROJECT is a directory, the algorithm in the main.py or Main.cs file inside it will be executed.
10441044
If PROJECT is a file, the algorithm in the specified file will be executed.
10451045
1046-
By default an interactive wizard is shown letting you configure the brokerage and data feed to use. If --environment,
1047-
--brokerage or --data-feed are given the command runs in non-interactive mode. In this mode the CLI does not prompt
1048-
for input.
1046+
By default an interactive wizard is shown letting you configure the brokerage and live data provider to use. If
1047+
--environment, --brokerage or --data-provider-live are given the command runs in non-interactive mode. In this mode
1048+
the CLI does not prompt for input.
10491049
10501050
If --environment is given it must be the name of a live environment in the Lean configuration.
10511051
1052-
If --brokerage and --data-feed are given, the options specific to the given brokerage/data feed must also be given.
1053-
The Lean config is used as fallback when a brokerage/data feed-specific option hasn't been passed in. If a required
1054-
option is not given and cannot be found in the Lean config the command aborts.
1052+
If --brokerage and --data-provider-live are given, the options specific to the given brokerage/live data provider must
1053+
also be given. The Lean config is used as fallback when a brokerage/live data provider-specific option hasn't been
1054+
passed in. If a required option is not given and cannot be found in the Lean config the command aborts.
10551055
10561056
By default the official LEAN engine image is used. You can override this using the --image option. Alternatively you
10571057
can set the default engine image for all commands using `lean config set engine-image <image>`.
@@ -1062,10 +1062,10 @@ Options:
10621062
-d, --detach Run the live deployment in a detached Docker container and return immediately
10631063
--brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade|Bybit]
10641064
The brokerage to use
1065-
--data-feed [Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Kraken|TDAmeritrade|IQFeed|Polygon|IEX|Custom data only|Bybit]
1066-
The data feed to use
1067-
--data-provider [IQFeed|Polygon|IEX|AlphaVantage|QuantConnect|Local]
1068-
Update the Lean configuration file to retrieve data from the given provider
1065+
--data-provider-live [Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Kraken|TDAmeritrade|IQFeed|Polygon|IEX|Custom data only|Bybit]
1066+
The live data provider to use
1067+
--data-provider-historical [IQFeed|Polygon|IEX|AlphaVantage|QuantConnect|Local]
1068+
Update the Lean configuration file to retrieve data from the given historical provider
10691069
--ib-user-name TEXT Your Interactive Brokers username
10701070
--ib-account TEXT Your Interactive Brokers account id
10711071
--ib-password TEXT Your Interactive Brokers password
@@ -1466,10 +1466,10 @@ Options:
14661466
--parameter <TEXT FLOAT FLOAT FLOAT>...
14671467
The 'parameter min max step' pairs configuring the parameters to optimize
14681468
--constraint TEXT The 'statistic operator value' pairs configuring the constraints of the optimization
1469-
--data-provider [IQFeed|Polygon|IEX|AlphaVantage|QuantConnect|Local|Terminal Link]
1470-
Update the Lean configuration file to retrieve data from the given provider
1469+
--data-provider-historical [IQFeed|Polygon|IEX|AlphaVantage|QuantConnect|Local|Terminal Link]
1470+
Update the Lean configuration file to retrieve data from the given historical provider
14711471
--download-data Update the Lean configuration file to download data from the QuantConnect API, alias
1472-
for --data-provider QuantConnect
1472+
for --data-provider-historical QuantConnect
14731473
--release Compile C# projects in release configuration instead of debug
14741474
--image TEXT The LEAN engine image to use (defaults to quantconnect/lean:latest)
14751475
--update Pull the LEAN engine image before running the optimizer
@@ -1606,8 +1606,8 @@ Usage: lean research [OPTIONS] PROJECT
16061606
16071607
Options:
16081608
--port INTEGER The port to run Jupyter Lab on (defaults to 8888)
1609-
--data-provider [IQFeed|Polygon|IEX|AlphaVantage|QuantConnect|Local|Terminal Link]
1610-
Update the Lean configuration file to retrieve data from the given provider
1609+
--data-provider-historical [IQFeed|Polygon|IEX|AlphaVantage|QuantConnect|Local|Terminal Link]
1610+
Update the Lean configuration file to retrieve data from the given historical provider
16111611
--iqfeed-iqconnect TEXT The path to the IQConnect binary
16121612
--iqfeed-username TEXT Your IQFeed username
16131613
--iqfeed-password TEXT Your IQFeed password
@@ -1633,9 +1633,9 @@ Options:
16331633
--terminal-link-openfigi-api-key TEXT
16341634
The Open FIGI API key to use for mapping options
16351635
--download-data Update the Lean configuration file to download data from the QuantConnect API, alias
1636-
for --data-provider QuantConnect
1636+
for --data-provider-historical QuantConnect
16371637
--data-purchase-limit INTEGER The maximum amount of QCC to spend on downloading data during the research session
1638-
when using QuantConnect as data provider
1638+
when using QuantConnect as historical data provider
16391639
-d, --detach Run Jupyter Lab in a detached Docker container and return immediately
16401640
--no-open Don't open the Jupyter Lab environment in the browser after starting it
16411641
--image TEXT The LEAN research image to use (defaults to quantconnect/research:latest)

lean/commands/backtest.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,18 @@ def _select_organization() -> QCMinimalOrganization:
251251
@option("--debug",
252252
type=Choice(["pycharm", "ptvsd", "vsdbg", "rider", "local-platform"], case_sensitive=False),
253253
help="Enable a certain debugging method (see --help for more information)")
254-
@option("--data-provider",
254+
@option("--data-provider-historical",
255255
type=Choice([dp.get_name() for dp in all_data_providers], case_sensitive=False),
256256
default="Local",
257-
help="Update the Lean configuration file to retrieve data from the given provider")
257+
help="Update the Lean configuration file to retrieve data from the given historical provider")
258258
@options_from_json(get_configs_for_options("backtest"))
259259
@option("--download-data",
260260
is_flag=True,
261261
default=False,
262-
help="Update the Lean configuration file to download data from the QuantConnect API, alias for --data-provider QuantConnect")
262+
help="Update the Lean configuration file to download data from the QuantConnect API, alias for --data-provider-historical QuantConnect")
263263
@option("--data-purchase-limit",
264264
type=int,
265-
help="The maximum amount of QCC to spend on downloading data during the backtest when using QuantConnect as data provider")
265+
help="The maximum amount of QCC to spend on downloading data during the backtest when using QuantConnect as historical data provider")
266266
@option("--release",
267267
is_flag=True,
268268
default=False,
@@ -301,7 +301,7 @@ def backtest(project: Path,
301301
output: Optional[Path],
302302
detach: bool,
303303
debug: Optional[str],
304-
data_provider: Optional[str],
304+
data_provider_historical: Optional[str],
305305
download_data: bool,
306306
data_purchase_limit: Optional[int],
307307
release: bool,
@@ -363,12 +363,12 @@ def backtest(project: Path,
363363
lean_config = lean_config_manager.get_complete_lean_config("backtesting", algorithm_file, debugging_method)
364364

365365
if download_data:
366-
data_provider = QuantConnectDataProvider.get_name()
366+
data_provider_historical = QuantConnectDataProvider.get_name()
367367

368368
organization_id = container.organization_manager.try_get_working_organization_id()
369369

370-
if data_provider is not None:
371-
data_provider_configurer: DataProvider = get_and_build_module(data_provider, all_data_providers, kwargs, logger)
370+
if data_provider_historical is not None:
371+
data_provider_configurer: DataProvider = get_and_build_module(data_provider_historical, all_data_providers, kwargs, logger)
372372
data_provider_configurer.ensure_module_installed(organization_id)
373373
data_provider_configurer.configure(lean_config, "backtesting")
374374

lean/commands/cloud/live/deploy.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -114,13 +114,13 @@ def _configure_brokerage(lean_config: Dict[str, Any], logger: Logger, user_provi
114114
hide_input=not show_secrets)
115115

116116
def _configure_data_feed(brokerage: CloudBrokerage, logger: Logger) -> None:
117-
"""Configures the data feed to use based on the brokerage given.
117+
"""Configures the live data provider to use based on the brokerage given.
118118
119119
:param brokerage: the cloud brokerage
120120
:param logger: the logger to use
121121
"""
122122
if len(cloud_brokerage_data_feeds[brokerage]) != 0:
123-
data_feed_selected = logger.prompt_list("Select a data feed", [
123+
data_feed_selected = logger.prompt_list("Select a live data provider", [
124124
Option(id=data_feed, label=data_feed) for data_feed in cloud_brokerage_data_feeds[brokerage]
125125
], multiple=False)
126126
data_feed_property_name = [name for name in brokerage.get_required_properties([InternalInputUserInput]) if ("data-feed" in name)]
@@ -265,7 +265,7 @@ def deploy(project: str,
265265
ensure_options(essential_properties)
266266
essential_properties_value = {brokerage_instance.convert_variable_to_lean_key(prop) : kwargs[prop] for prop in essential_properties}
267267
brokerage_instance.update_configs(essential_properties_value)
268-
# now required properties can be fetched as per data provider from essential properties
268+
# now required properties can be fetched as per historical data provider from essential properties
269269
required_properties = [brokerage_instance.convert_lean_key_to_variable(prop) for prop in brokerage_instance.get_required_properties([InternalInputUserInput])]
270270
ensure_options(required_properties)
271271
required_properties_value = {brokerage_instance.convert_variable_to_lean_key(prop) : kwargs[prop] for prop in required_properties}
@@ -340,7 +340,7 @@ def deploy(project: str,
340340
logger.info(f"Environment: {brokerage_settings['environment'].title()}")
341341
logger.info(f"Server name: {live_node.name}")
342342
logger.info(f"Server type: {live_node.sku}")
343-
logger.info(f"Data provider: {price_data_handler.replace('Handler', '')}")
343+
logger.info(f"Live data provider: {price_data_handler.replace('Handler', '')}")
344344
logger.info(f"LEAN version: {cloud_project.leanVersionId}")
345345
logger.info(f"Order event notifications: {'Yes' if notify_order_events else 'No'}")
346346
logger.info(f"Insight notifications: {'Yes' if notify_insights else 'No'}")

lean/commands/live/deploy.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def _configure_lean_config_interactively(lean_config: Dict[str, Any],
171171

172172
brokerage.build(lean_config, logger, properties, hide_input=not show_secrets).configure(lean_config, environment_name)
173173

174-
data_feeds = logger.prompt_list("Select a data feed", [
174+
data_feeds = logger.prompt_list("Select a live data provider", [
175175
Option(id=data_feed, label=data_feed.get_name()) for data_feed in local_brokerage_data_feeds[brokerage]
176176
], multiple= True)
177177
for data_feed in data_feeds:
@@ -228,14 +228,14 @@ def _get_default_value(key: str) -> Optional[Any]:
228228
@option("--brokerage",
229229
type=Choice([b.get_name() for b in all_local_brokerages], case_sensitive=False),
230230
help="The brokerage to use")
231-
@option("--data-feed",
231+
@option("--data-provider-live",
232232
type=Choice([d.get_name() for d in all_local_data_feeds], case_sensitive=False),
233233
multiple=True,
234-
help="The data feed to use")
235-
@option("--data-provider",
234+
help="The live data provider to use")
235+
@option("--data-provider-historical",
236236
type=Choice([dp.get_name() for dp in all_data_providers if dp._id != "TerminalLinkBrokerage"], case_sensitive=False),
237237
default="Local",
238-
help="Update the Lean configuration file to retrieve data from the given provider")
238+
help="Update the Lean configuration file to retrieve data from the given historical provider")
239239
@options_from_json(get_configs_for_options("live-local"))
240240
@option("--release",
241241
is_flag=True,
@@ -282,8 +282,8 @@ def deploy(project: Path,
282282
output: Optional[Path],
283283
detach: bool,
284284
brokerage: Optional[str],
285-
data_feed: Optional[str],
286-
data_provider: Optional[str],
285+
data_provider_live: Optional[str],
286+
data_provider_historical: Optional[str],
287287
release: bool,
288288
image: Optional[str],
289289
python_venv: Optional[str],
@@ -302,14 +302,14 @@ def deploy(project: Path,
302302
If PROJECT is a directory, the algorithm in the main.py or Main.cs file inside it will be executed.
303303
If PROJECT is a file, the algorithm in the specified file will be executed.
304304
305-
By default an interactive wizard is shown letting you configure the brokerage and data feed to use.
306-
If --environment, --brokerage or --data-feed are given the command runs in non-interactive mode.
305+
By default an interactive wizard is shown letting you configure the brokerage and live data provider to use.
306+
If --environment, --brokerage or --data-provider-live are given the command runs in non-interactive mode.
307307
In this mode the CLI does not prompt for input.
308308
309309
If --environment is given it must be the name of a live environment in the Lean configuration.
310310
311-
If --brokerage and --data-feed are given, the options specific to the given brokerage/data feed must also be given.
312-
The Lean config is used as fallback when a brokerage/data feed-specific option hasn't been passed in.
311+
If --brokerage and --data-provider-live are given, the options specific to the given brokerage/live data provider must also be given.
312+
The Lean config is used as fallback when a brokerage/live data provider-specific option hasn't been passed in.
313313
If a required option is not given and cannot be found in the Lean config the command aborts.
314314
315315
By default the official LEAN engine image is used.
@@ -333,8 +333,8 @@ def deploy(project: Path,
333333

334334
lean_config_manager = container.lean_config_manager
335335

336-
if environment is not None and (brokerage is not None or len(data_feed) > 0):
337-
raise RuntimeError("--environment and --brokerage + --data-feed are mutually exclusive")
336+
if environment is not None and (brokerage is not None or len(data_provider_live) > 0):
337+
raise RuntimeError("--environment and --brokerage + --data-provider-live are mutually exclusive")
338338

339339
if environment is not None:
340340
environment_name = environment
@@ -385,7 +385,7 @@ def deploy(project: Path,
385385
[update_essential_properties_available([brokerage_configurer], kwargs)]
386386
[update_essential_properties_available(data_feed_configurers, kwargs)]
387387

388-
elif brokerage is not None or len(data_feed) > 0:
388+
elif brokerage is not None or len(data_provider_live) > 0:
389389
ensure_options(["brokerage", "data_feed"])
390390

391391
environment_name = "lean-cli"
@@ -398,7 +398,7 @@ def deploy(project: Path,
398398
[brokerage_configurer] = [get_and_build_module(brokerage, all_local_brokerages, kwargs, logger)]
399399
brokerage_configurer.configure(lean_config, environment_name)
400400

401-
for df in data_feed:
401+
for df in data_provider_live:
402402
[data_feed_configurer] = [get_and_build_module(df, all_local_data_feeds, kwargs, logger)]
403403
data_feed_configurer.configure(lean_config, environment_name)
404404

@@ -407,8 +407,8 @@ def deploy(project: Path,
407407
lean_config = lean_config_manager.get_complete_lean_config(environment_name, algorithm_file, None)
408408
_configure_lean_config_interactively(lean_config, environment_name, kwargs, show_secrets=show_secrets)
409409

410-
if data_provider is not None:
411-
[data_provider_configurer] = [get_and_build_module(data_provider, all_data_providers, kwargs, logger)]
410+
if data_provider_historical is not None:
411+
[data_provider_configurer] = [get_and_build_module(data_provider_historical, all_data_providers, kwargs, logger)]
412412
data_provider_configurer.configure(lean_config, environment_name)
413413

414414
if "environments" not in lean_config or environment_name not in lean_config["environments"]:
@@ -444,7 +444,7 @@ def deploy(project: Path,
444444
cash_balance_option, holdings_option, last_cash, last_holdings = get_last_portfolio_cash_holdings(container.api_client, env_brokerage,
445445
project_config.get("cloud-id", None), project)
446446

447-
if environment is None and brokerage is None and len(data_feed) == 0: # condition for using interactive panel
447+
if environment is None and brokerage is None and len(data_provider_live) == 0: # condition for using interactive panel
448448
if cash_balance_option != LiveInitialStateInput.NotSupported:
449449
live_cash_balance = _configure_initial_cash_interactively(logger, cash_balance_option, last_cash)
450450

0 commit comments

Comments
 (0)