From b6e5585a230c40f998f5b822abaad8433bf50c46 Mon Sep 17 00:00:00 2001 From: Ronit Jain Date: Thu, 21 Sep 2023 18:14:26 +0530 Subject: [PATCH] Update Messaging Logging Required for Terminal Link Configuration (#361) * log messages for internal input type * update readme --- README.md | 31 ++++++++++++++++++++++++++----- lean/models/json_module.py | 5 +++-- 2 files changed, 29 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 1d603018..b5b1071f 100644 --- a/README.md +++ b/README.md @@ -143,6 +143,9 @@ Options: Enable a certain debugging method (see --help for more information) --data-provider [QuantConnect|Local|Terminal Link] Update the Lean configuration file to retrieve data from the given provider + --terminal-link-connection-type [DAPI|SAPI] + Terminal Link Connection Type [DAPI, SAPI] + --terminal-link-auth-id TEXT The Auth ID of the TerminalLink server --terminal-link-environment [Production|Beta] The environment to run in --terminal-link-server-host TEXT @@ -262,7 +265,7 @@ Usage: lean cloud live deploy [OPTIONS] PROJECT --notify-insights. Options: - --brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Pro|Binance|Zerodha|Samco|Trading Technologies|Kraken|TDAmeritrade] + --brokerage [Paper Trading|Interactive Brokers|Tradier|Oanda|Bitfinex|Coinbase Pro|Binance|Zerodha|Samco|Terminal Link|Trading Technologies|Kraken|TDAmeritrade] The brokerage to use --ib-user-name TEXT Your Interactive Brokers username --ib-account TEXT Your Interactive Brokers account id @@ -272,15 +275,14 @@ Options: this time, and will require 2FA verification. This is required by Interactive Brokers. Use this option explicitly to override the default value. --ib-data-feed [QuantConnect|Interactive Brokers|QuantConnect + InteractiveBrokers] - The data feed to use. These are the available ones: Interactive Brokers price data - feed, QuantConnect price data feed or QuantConnect + InteractiveBrokers price data feed. + The available price data feeds are: Interactive Brokers price data feed, QuantConnect + price data feed or QuantConnect + InteractiveBrokers price data feed --tradier-account-id TEXT Your Tradier account id --tradier-access-token TEXT Your Tradier access token --tradier-environment [live|paper] Whether the developer sandbox should be used --tradier-data-feed [QuantConnect|Tradier Brokerage] - The data feed to use. These are the available ones: QuantConnect price data feed or - Tradier Brokerage data feed. + Whether the Tradier data feed must be used instead of the QuantConnect price data feed --oanda-account-id TEXT Your OANDA account id --oanda-access-token TEXT Your OANDA API token --oanda-environment [Practice|Trade] @@ -319,6 +321,19 @@ Options: --samco-trading-segment [equity|commodity] EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading commodities on MCX + --terminal-link-auth-id TEXT The Auth ID of the TerminalLink server + --terminal-link-environment [Production|Beta] + The environment to run in + --terminal-link-server-host TEXT + The host of the SAPI server + --terminal-link-server-port INTEGER + The port of the SAPI server + --terminal-link-emsx-broker TEXT + The EMSX broker to use + --terminal-link-emsx-account TEXT + The EMSX account to use + --terminal-link-openfigi-api-key TEXT + The Open FIGI API key to use for mapping options --tt-user-name TEXT Your Trading Technologies username --tt-session-password TEXT Your Trading Technologies session password --tt-account-name TEXT Your Trading Technologies account name @@ -1043,6 +1058,9 @@ Options: --samco-trading-segment [equity|commodity] EQUITY if you are trading equities on NSE or BSE, COMMODITY if you are trading commodities on MCX + --terminal-link-connection-type [DAPI|SAPI] + Terminal Link Connection Type [DAPI, SAPI] + --terminal-link-auth-id TEXT The Auth ID of the TerminalLink server --terminal-link-environment [Production|Beta] The environment to run in --terminal-link-server-host TEXT @@ -1495,6 +1513,9 @@ Options: --port INTEGER The port to run Jupyter Lab on (defaults to 8888) --data-provider [QuantConnect|Local|Terminal Link] Update the Lean configuration file to retrieve data from the given provider + --terminal-link-connection-type [DAPI|SAPI] + Terminal Link Connection Type [DAPI, SAPI] + --terminal-link-auth-id TEXT The Auth ID of the TerminalLink server --terminal-link-environment [Production|Beta] The environment to run in --terminal-link-server-host TEXT diff --git a/lean/models/json_module.py b/lean/models/json_module.py index 9241a298..b3e1ff76 100644 --- a/lean/models/json_module.py +++ b/lean/models/json_module.py @@ -168,14 +168,15 @@ def build(self, continue if not configuration._is_required_from_user: continue - if type(configuration) is InternalInputUserInput: - continue if self.__class__.__name__ == 'CloudBrokerage' and not configuration._is_cloud_property: continue + # Lets log messages for internal input configurations as well if configuration._log_message is not None: log_message = configuration._log_message.strip() if log_message: logger.info(log_message) + if type(configuration) is InternalInputUserInput: + continue # filter properties that were not passed as command line arguments, # so that we prompt the user for them only when they don't have a value in the Lean config