diff --git a/README.md b/README.md index 42bb67d6..91b53c5c 100644 --- a/README.md +++ b/README.md @@ -160,8 +160,9 @@ Options: The environment to run in, Practice for fxTrade Practice, Trade for fxTrade --bitfinex-api-key TEXT Your Bitfinex API key --bitfinex-api-secret TEXT Your Bitfinex API secret - --coinbase-api-key TEXT Your Coinbase Advanced Trade API key - --coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret + --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file. + --coinbase-api-private-key TEXT + Your Coinbase Advanced Trade API private key from file. --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures] Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures] --binance-api-key TEXT Your Binance API key @@ -345,8 +346,9 @@ Options: The environment to run in, Practice for fxTrade Practice, Trade for fxTrade --bitfinex-api-key TEXT Your Bitfinex API key --bitfinex-api-secret TEXT Your Bitfinex API secret - --coinbase-api-key TEXT Your Coinbase Advanced Trade API key - --coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret + --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file. + --coinbase-api-private-key TEXT + Your Coinbase Advanced Trade API private key from file. --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures] Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures] --binance-api-key TEXT Your Binance API key @@ -841,8 +843,9 @@ Options: The environment to run in, Practice for fxTrade Practice, Trade for fxTrade --bitfinex-api-key TEXT Your Bitfinex API key --bitfinex-api-secret TEXT Your Bitfinex API secret - --coinbase-api-key TEXT Your Coinbase Advanced Trade API key - --coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret + --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file. + --coinbase-api-private-key TEXT + Your Coinbase Advanced Trade API private key from file. --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures] Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures] --binance-api-key TEXT Your Binance API key @@ -1265,8 +1268,9 @@ Options: The environment to run in, Practice for fxTrade Practice, Trade for fxTrade --bitfinex-api-key TEXT Your Bitfinex API key --bitfinex-api-secret TEXT Your Bitfinex API secret - --coinbase-api-key TEXT Your Coinbase Advanced Trade API key - --coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret + --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file. + --coinbase-api-private-key TEXT + Your Coinbase Advanced Trade API private key from file. --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures] Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures] --binance-api-key TEXT Your Binance API key @@ -1710,8 +1714,9 @@ Options: The environment to run in, Practice for fxTrade Practice, Trade for fxTrade --bitfinex-api-key TEXT Your Bitfinex API key --bitfinex-api-secret TEXT Your Bitfinex API secret - --coinbase-api-key TEXT Your Coinbase Advanced Trade API key - --coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret + --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file. + --coinbase-api-private-key TEXT + Your Coinbase Advanced Trade API private key from file. --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures] Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures] --binance-api-key TEXT Your Binance API key @@ -1881,8 +1886,9 @@ Options: The environment to run in, Practice for fxTrade Practice, Trade for fxTrade --bitfinex-api-key TEXT Your Bitfinex API key --bitfinex-api-secret TEXT Your Bitfinex API secret - --coinbase-api-key TEXT Your Coinbase Advanced Trade API key - --coinbase-api-secret TEXT Your Coinbase Advanced Trade API secret + --coinbase-api-name TEXT Your Coinbase Advanced Trade API name from file. + --coinbase-api-private-key TEXT + Your Coinbase Advanced Trade API private key from file. --binance-exchange-name [Binance|BinanceUS|Binance-USDM-Futures|Binance-COIN-Futures] Binance exchange name [Binance, BinanceUS, Binance-USDM-Futures, Binance-COIN-Futures] --binance-api-key TEXT Your Binance API key diff --git a/lean/models/json_module.py b/lean/models/json_module.py index 6003af34..8b18f4ef 100644 --- a/lean/models/json_module.py +++ b/lean/models/json_module.py @@ -137,7 +137,14 @@ def get_settings(self) -> Dict[str, str]: for key, value in configuration._value.items(): settings[key] = str(value) else: - settings[configuration._id] = str(configuration._value).replace("\\", "/") + # Replace escaped newline characters and backslashes in the configuration value. + # When reading the JSON configuration through Python, newline characters ('\n') and backslashes ('\') + # may be escaped, causing issues in scenarios where these characters are expected to be interpreted + # literally (e.g., file paths, multi-line strings). This replace operation ensures that: + # 1. Escaped newline characters ('\\n') are correctly interpreted as actual newlines ('\n'). + # 2. Backslashes ('\\') in file paths are converted to forward slashes ('/'), making paths + # more consistent across different operating systems. + settings[configuration._id] = str(configuration._value).replace("\\n", "\n").replace("\\", "/") return settings