Skip to content

Commit

Permalink
Remove: IEX data provider (#537)
Browse files Browse the repository at this point in the history
* remove: IEX from README.md

* remove: all IEX mention in test_live.py
  • Loading branch information
Romazes authored Jan 10, 2025
1 parent 52437d0 commit 71f231b
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 52 deletions.
32 changes: 7 additions & 25 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ Options:
-d, --detach Run the backtest in a detached Docker container and return immediately
--debug [pycharm|ptvsd|debugpy|vsdbg|rider|local-platform]
Enable a certain debugging method (see --help for more information)
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
Update the Lean configuration file to retrieve data from the given historical provider
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
Expand Down Expand Up @@ -188,9 +188,6 @@ Options:
--polygon-api-key TEXT Your Polygon.io API Key
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
Expand Down Expand Up @@ -353,7 +350,7 @@ Usage: lean cloud live deploy [OPTIONS] PROJECT
Options:
--brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|CharlesSchwab|Bybit|TradeStation|Alpaca]
The brokerage to use
--data-provider-live [QuantConnect|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|CharlesSchwab|Polygon|IEX|CoinApi|Bybit|TradeStation|Alpaca]
--data-provider-live [QuantConnect|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|CharlesSchwab|Polygon|CoinApi|Bybit|TradeStation|Alpaca]
The live data provider to use
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
Expand Down Expand Up @@ -442,9 +439,6 @@ Options:
--alpaca-environment [live|paper]
Whether Live or Paper environment should be used
--polygon-api-key TEXT Your Polygon.io API Key
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--coinapi-api-key TEXT Your coinapi.io Api Key
--coinapi-product [Free|Startup|Streamer|Professional|Enterprise]
CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)
Expand Down Expand Up @@ -851,7 +845,7 @@ Usage: lean data download [OPTIONS]
https://www.quantconnect.com/datasets
Options:
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
The name of the downloader data provider.
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
Expand Down Expand Up @@ -889,9 +883,6 @@ Options:
--polygon-api-key TEXT Your Polygon.io API Key
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
Expand Down Expand Up @@ -1292,9 +1283,9 @@ Options:
-d, --detach Run the live deployment in a detached Docker container and return immediately
--brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|CharlesSchwab|Bybit|TradeStation|Alpaca]
The brokerage to use
--data-provider-live [Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|CharlesSchwab|IQFeed|Polygon|IEX|CoinApi|ThetaData|Custom data only|Bybit|TradeStation|Alpaca]
--data-provider-live [Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|CharlesSchwab|IQFeed|Polygon|CoinApi|ThetaData|Custom data only|Bybit|TradeStation|Alpaca]
The live data provider to use
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Bybit|TradeStation|Alpaca]
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Bybit|TradeStation|Alpaca]
Update the Lean configuration file to retrieve data from the given historical provider
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
Expand Down Expand Up @@ -1409,9 +1400,6 @@ Options:
--iqfeed-version TEXT The product version of your IQFeed developer account
--iqfeed-host TEXT The IQFeed host address (Optional).
--polygon-api-key TEXT Your Polygon.io API Key
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--coinapi-api-key TEXT Your coinapi.io Api Key
--coinapi-product [Free|Startup|Streamer|Professional|Enterprise]
CoinApi pricing plan (https://www.coinapi.io/market-data-api/pricing)
Expand Down Expand Up @@ -1734,7 +1722,7 @@ Options:
--parameter <TEXT FLOAT FLOAT FLOAT>...
The 'parameter min max step' pairs configuring the parameters to optimize
--constraint TEXT The 'statistic operator value' pairs configuring the constraints of the optimization
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
Update the Lean configuration file to retrieve data from the given historical provider
--download-data Update the Lean configuration file to download data from the QuantConnect API, alias
for --data-provider-historical QuantConnect
Expand Down Expand Up @@ -1785,9 +1773,6 @@ Options:
--polygon-api-key TEXT Your Polygon.io API Key
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
Expand Down Expand Up @@ -1995,7 +1980,7 @@ Usage: lean research [OPTIONS] PROJECT
Options:
--port INTEGER The port to run Jupyter Lab on (defaults to 8888)
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|IEX|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
--data-provider-historical [Interactive Brokers|Oanda|Bitfinex|Coinbase Advanced Trade|Binance|Kraken|CharlesSchwab|IQFeed|Polygon|FactSet|AlphaVantage|CoinApi|ThetaData|QuantConnect|Local|Terminal Link|Bybit|TradeStation|Alpaca]
Update the Lean configuration file to retrieve data from the given historical provider
--ib-user-name TEXT Your Interactive Brokers username
--ib-account TEXT Your Interactive Brokers account id
Expand Down Expand Up @@ -2033,9 +2018,6 @@ Options:
--polygon-api-key TEXT Your Polygon.io API Key
--factset-auth-config-file FILE
The path to the FactSet authentication configuration file
--iex-cloud-api-key TEXT Your iexcloud.io API token publishable key
--iex-price-plan [Launch|Grow|Enterprise]
Your IEX Cloud Price plan
--alpha-vantage-api-key TEXT Your Alpha Vantage Api Key
--alpha-vantage-price-plan [Free|Plan30|Plan75|Plan150|Plan300|Plan600|Plan1200]
Your Alpha Vantage Premium API Key plan
Expand Down
44 changes: 17 additions & 27 deletions tests/commands/test_live.py
Original file line number Diff line number Diff line change
Expand Up @@ -457,9 +457,8 @@ def test_live_sets_dependent_configurations_from_modules_json_based_on_environme
}

data_provider_required_options = {
"IEX": {
"iex-cloud-api-key": "123",
"iex-price-plan": "Launch",
"ThetaData": {
"thetadata-subscription-plan": "Pro",
},
"Polygon": {
"polygon-api-key": "123",
Expand Down Expand Up @@ -1130,9 +1129,7 @@ def test_live_non_interactive_deploy_with_live_and_historical_provider_missed_hi

container.initialize(docker_manager=mock.Mock(), lean_runner=mock.Mock(), api_client = mock.MagicMock())

provider_live_option = ["--data-provider-live", "IEX",
"--iex-cloud-api-key", "123",
"--iex-price-plan", "Launch"]
provider_live_option = ["--data-provider-live", "Polygon" ]

provider_history_option = ["--data-provider-historical", "Polygon"]
# "--polygon-api-key", "123"]
Expand All @@ -1145,7 +1142,6 @@ def test_live_non_interactive_deploy_with_live_and_historical_provider_missed_hi
error_msg = str(result.exc_info[1]).split()

assert "--polygon-api-key" in error_msg
assert "--iex-cloud-api-key" not in error_msg

assert result.exit_code == 1

Expand All @@ -1155,11 +1151,9 @@ def test_live_non_interactive_deploy_with_live_and_historical_provider_missed_li

container.initialize(docker_manager=mock.Mock(), lean_runner=mock.Mock(), api_client = mock.MagicMock())

provider_live_option = ["--data-provider-live", "IEX",
"--iex-cloud-api-key", "123"]
#"--iex-price-plan", "Launch"]
provider_live_option = ["--data-provider-live", "Polygon", "--polygon-api-key", "123"]

provider_history_option = ["--data-provider-historical", "Polygon", "--polygon-api-key", "123"]
provider_history_option = ["--data-provider-historical", "Polygon"]

result = CliRunner().invoke(lean, ["live", "deploy", "--brokerage", "Paper Trading",
*provider_live_option,
Expand All @@ -1169,10 +1163,9 @@ def test_live_non_interactive_deploy_with_live_and_historical_provider_missed_li

error_msg = str(result.exc_info[1]).split()

assert "--iex-price-plan" in error_msg
assert "--polygon-api-key" not in error_msg

assert result.exit_code == 1
assert result.exit_code == 0

def test_live_non_interactive_deploy_with_real_brokerage_without_credentials() -> None:
create_fake_lean_cli_directory()
Expand All @@ -1183,9 +1176,7 @@ def test_live_non_interactive_deploy_with_real_brokerage_without_credentials() -
# create fake environment has IB configs already
brokerage = ["--brokerage", "OANDA"]

provider_live_option = ["--data-provider-live", "IEX",
"--iex-cloud-api-key", "123",
"--iex-price-plan", "Launch"]
provider_live_option = ["--data-provider-live", "Polygon", "--polygon-api-key", "123"]

result = CliRunner().invoke(lean, ["live", "deploy",
*brokerage,
Expand All @@ -1199,7 +1190,6 @@ def test_live_non_interactive_deploy_with_real_brokerage_without_credentials() -
assert "--oanda-account-id" in error_msg
assert "--oanda-access-token" in error_msg
assert "--oanda-environment" in error_msg
assert "--iex-price-plan" not in error_msg


def create_lean_option(brokerage_name: str, data_provider_live_name: str, data_provider_historical_name: str,
Expand Down Expand Up @@ -1239,10 +1229,10 @@ def create_lean_option(brokerage_name: str, data_provider_live_name: str, data_p
return result

@pytest.mark.parametrize("brokerage_name,data_provider_live_name,data_provider_historical_name,brokerage_product_id,data_provider_live_product_id,data_provider_historical_id",
[("Interactive Brokers", "IEX", "Polygon", "181", "333", "306"),
("Paper Trading", "IEX", "Polygon", None, "333", "306"),
("Tradier", "IEX", "AlphaVantage", "185", "333", "334"),
("Paper Trading", "IEX", "Local", None, "333", "222")])
[("Interactive Brokers", "ThetaData", "Polygon", "181", "344", "306"),
("Paper Trading", "ThetaData", "Polygon", None, "344", "306"),
("Tradier", "ThetaData", "AlphaVantage", "185", "344", "334"),
("Paper Trading", "ThetaData", "Local", None, "344", "222")])
def test_live_deploy_with_different_brokerage_and_different_live_data_provider_and_historical_data_provider(brokerage_name: str, data_provider_live_name: str, data_provider_historical_name: str, brokerage_product_id: str, data_provider_live_product_id: str, data_provider_historical_id: str) -> None:
if (brokerage_name == "Interactive Brokers" and sys.platform == "darwin"):
pytest.skip("MacOS does not support IB tests")
Expand All @@ -1257,10 +1247,10 @@ def test_live_deploy_with_different_brokerage_and_different_live_data_provider_a
if id in m_c[1]:
is_exists.append(True)
assert is_exists
assert len(is_exists) == 2
assert len(is_exists) == 1
elif brokerage_product_id is None and data_provider_historical_name == "Local":
assert len(api_client.method_calls) == 1
if data_provider_live_product_id in api_client.method_calls[0][1]:
if int(data_provider_live_product_id) in api_client.method_calls[0][1]:
is_exists.append(True)
assert is_exists
assert len(is_exists) == 1
Expand All @@ -1273,8 +1263,8 @@ def test_live_deploy_with_different_brokerage_and_different_live_data_provider_a
assert len(is_exists) == 3

@pytest.mark.parametrize("brokerage_name,data_provider_live_name,brokerage_product_id,data_provider_live_product_id",
[("Interactive Brokers", "IEX", "181", "333"),
("Tradier", "IEX", "185", "333")])
[("Interactive Brokers", "Polygon", "181", "306"),
("Tradier", "Polygon", "185", "306")])
def test_live_non_interactive_deploy_with_different_brokerage_and_different_live_data_provider(brokerage_name: str, data_provider_live_name: str, brokerage_product_id: str, data_provider_live_product_id: str) -> None:
if (brokerage_name == "Interactive Brokers" and sys.platform == "darwin"):
pytest.skip("MacOS does not support IB tests")
Expand Down Expand Up @@ -1313,15 +1303,15 @@ def test_live_non_interactive_deploy_with_different_brokerage_with_the_same_live
assert is_exist

@pytest.mark.parametrize("brokerage_name,data_provider_live_name,data_provider_live_product_id",
[("Paper Trading", "IEX", "333"),
[("Paper Trading", "ThetaData", "344"),
("Paper Trading", "Polygon", "306")])
def test_live_non_interactive_deploy_paper_brokerage_different_live_data_provider(brokerage_name: str, data_provider_live_name: str, data_provider_live_product_id: str) -> None:
api_client = mock.MagicMock()
create_lean_option(brokerage_name, data_provider_live_name, None, api_client)

assert len(api_client.method_calls) == 1
for m_c in api_client.method_calls:
if data_provider_live_product_id in m_c[1]:
if data_provider_live_product_id in str(m_c[1]):
is_exist = True

assert is_exist
Expand Down

0 comments on commit 71f231b

Please sign in to comment.