Skip to content

Commit

Permalink
More fixes and improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin-Molinero committed May 2, 2024
1 parent 8ed68ae commit b5f50a0
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 11 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -880,14 +880,14 @@ Options:
--dataset TEXT The name of the dataset to download non-interactively
--overwrite Overwrite existing local data
-y, --yes Automatically confirm payment confirmation prompts
--data-type [Trade|Quote|OpenInterest]
--data-type [Trade|Quote|Bulk|OpenInterest]
Specify the type of historical data
--resolution [Tick|Second|Minute|Hour|Daily]
Specify the resolution of the historical data
--security-type [Equity|Index|Forex|Cfd|Future|Crypto|CryptoFuture|Option|IndexOption|Commodity|FutureOption]
Specify the security type of the historical data
--market TEXT Specify the market name for tickers (e.g., 'USA', 'NYMEX', 'Binance')
--tickers TEXT Specify comma separated list of tickers to use for historical data request.
--ticker TEXT Specify comma separated list of tickers to use for historical data request.
--start-date TEXT Specify the start date for the historical data request in the format yyyyMMdd.
--end-date TEXT Specify the end date for the historical data request in the format yyyyMMdd. (defaults
to today)
Expand Down
21 changes: 12 additions & 9 deletions lean/commands/data/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ def _configure_date_option(date_value: str, option_id: str, option_label: str) -
help="Specify the security type of the historical data")
@option("--market", type=str,
help="Specify the market name for tickers (e.g., 'USA', 'NYMEX', 'Binance')")
@option("--tickers",
@option("--ticker",
type=str,
help="Specify comma separated list of tickers to use for historical data request.")
@option("--start-date",
Expand Down Expand Up @@ -544,7 +544,7 @@ def download(ctx: Context,
resolution: Optional[str],
security_type: Optional[str],
market: Optional[str],
tickers: Optional[str],
ticker: Optional[str],
start_date: Optional[str],
end_date: Optional[str],
image: Optional[str],
Expand Down Expand Up @@ -576,6 +576,9 @@ def download(ctx: Context,
"""
organization = _get_organization()

if dataset:
data_provider_historical = 'QuantConnect'

if data_provider_historical is None:
data_provider_historical = _get_historical_data_provider()

Expand Down Expand Up @@ -627,12 +630,12 @@ def download(ctx: Context,
market = _get_user_input_or_prompt(market, data_provider_support_markets,
data_provider_historical, "Select a Market")

if not tickers:
tickers = ','.join(DatasetTextOption(id="id",
label="Enter comma separated list of tickers to use for historical data request.",
description="description",
transform=DatasetTextOptionTransform.Lowercase,
multiple=True).configure_interactive().value)
if not ticker:
ticker = ','.join(DatasetTextOption(id="id",
label="Enter comma separated list of tickers to use for historical data request.",
description="description",
transform=DatasetTextOptionTransform.Lowercase,
multiple=True).configure_interactive().value)

start_date = _configure_date_option(start_date, "start", "Please enter a Start Date in the format")
end_date = _configure_date_option(end_date, "end", "Please enter a End Date in the format")
Expand Down Expand Up @@ -680,7 +683,7 @@ def download(ctx: Context,
"--security-type", security_type,
"--market", market,
"--resolution", resolution,
"--tickers", tickers]
"--tickers", ticker]

run_options["commands"].append(' '.join(dll_arguments))

Expand Down

0 comments on commit b5f50a0

Please sign in to comment.