From 1d10d2c87c0a53acfe11569da6a54c8b9952dcd6 Mon Sep 17 00:00:00 2001 From: Matthias Date: Tue, 8 Feb 2022 19:45:39 +0100 Subject: [PATCH] Okex -> okx --- README.md | 2 +- docs/exchanges.md | 8 ++++---- docs/index.md | 2 +- freqtrade/commands/build_config_commands.py | 4 ++-- freqtrade/exchange/__init__.py | 2 +- freqtrade/exchange/common.py | 1 + freqtrade/exchange/exchange.py | 2 +- freqtrade/exchange/{okex.py => okx.py} | 4 ++-- tests/exchange/test_ccxt_compat.py | 2 +- 9 files changed, 14 insertions(+), 13 deletions(-) rename freqtrade/exchange/{okex.py => okx.py} (84%) diff --git a/README.md b/README.md index b67e16010..d85eef71a 100644 --- a/README.md +++ b/README.md @@ -31,7 +31,7 @@ Please read the [exchange specific notes](docs/exchanges.md) to learn about even - [X] [FTX](https://ftx.com) - [X] [Gate.io](https://www.gate.io/ref/6266643) - [X] [Kraken](https://kraken.com/) -- [X] [OKEX](https://www.okex.com/) +- [X] [OKX](https://www.okx.com/) - [ ] [potentially many others](https://github.com/ccxt/ccxt/). _(We cannot guarantee they will work)_ ### Community tested diff --git a/docs/exchanges.md b/docs/exchanges.md index 374a6b8cc..e79abf220 100644 --- a/docs/exchanges.md +++ b/docs/exchanges.md @@ -182,13 +182,13 @@ Kucoin supports [time_in_force](configuration.md#understand-order_time_in_force) For Kucoin, please add `"KCS/"` to your blacklist to avoid issues. Accounts having KCS accounts use this to pay for fees - if your first trade happens to be on `KCS`, further trades will consume this position and make the initial KCS trade unsellable as the expected amount is not there anymore. -## OKEX +## OKX -OKEX requires a passphrase for each api key, you will therefore need to add this key into the configuration so your exchange section looks as follows: +OKX requires a passphrase for each api key, you will therefore need to add this key into the configuration so your exchange section looks as follows: ```json "exchange": { - "name": "okex", + "name": "okx", "key": "your_exchange_key", "secret": "your_exchange_secret", "password": "your_exchange_api_key_password", @@ -197,7 +197,7 @@ OKEX requires a passphrase for each api key, you will therefore need to add this ``` !!! Warning - OKEX only provides 100 candles per api call. Therefore, the strategy will only have a pretty low amount of data available in backtesting mode. + OKX only provides 100 candles per api call. Therefore, the strategy will only have a pretty low amount of data available in backtesting mode. ## Gate.io diff --git a/docs/index.md b/docs/index.md index 1f8f15704..7ae110320 100644 --- a/docs/index.md +++ b/docs/index.md @@ -41,7 +41,7 @@ Please read the [exchange specific notes](exchanges.md) to learn about eventual, - [X] [FTX](https://ftx.com) - [X] [Gate.io](https://www.gate.io/ref/6266643) - [X] [Kraken](https://kraken.com/) -- [X] [OKEX](https://www.okex.com/) +- [X] [OKX](https://www.okx.com/) - [ ] [potentially many others through ccxt](https://github.com/ccxt/ccxt/). _(We cannot guarantee they will work)_ ### Community tested diff --git a/freqtrade/commands/build_config_commands.py b/freqtrade/commands/build_config_commands.py index ca3f11a21..4c722c810 100644 --- a/freqtrade/commands/build_config_commands.py +++ b/freqtrade/commands/build_config_commands.py @@ -112,7 +112,7 @@ def ask_user_config() -> Dict[str, Any]: "ftx", "kucoin", "gateio", - "okex", + "okx", Separator(), "other", ], @@ -140,7 +140,7 @@ def ask_user_config() -> Dict[str, Any]: "type": "password", "name": "exchange_key_password", "message": "Insert Exchange API Key password", - "when": lambda x: not x['dry_run'] and x['exchange_name'] in ('kucoin', 'okex') + "when": lambda x: not x['dry_run'] and x['exchange_name'] in ('kucoin', 'okx') }, { "type": "confirm", diff --git a/freqtrade/exchange/__init__.py b/freqtrade/exchange/__init__.py index b356a8147..9dc2b8480 100644 --- a/freqtrade/exchange/__init__.py +++ b/freqtrade/exchange/__init__.py @@ -20,4 +20,4 @@ from freqtrade.exchange.gateio import Gateio from freqtrade.exchange.hitbtc import Hitbtc from freqtrade.exchange.kraken import Kraken from freqtrade.exchange.kucoin import Kucoin -from freqtrade.exchange.okex import Okex +from freqtrade.exchange.okx import Okx diff --git a/freqtrade/exchange/common.py b/freqtrade/exchange/common.py index a6d3896eb..fad905b04 100644 --- a/freqtrade/exchange/common.py +++ b/freqtrade/exchange/common.py @@ -35,6 +35,7 @@ BAD_EXCHANGES = { MAP_EXCHANGE_CHILDCLASS = { 'binanceus': 'binance', 'binanceje': 'binance', + 'okex': 'okx', } diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 004fb2437..a2217a02e 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -1587,7 +1587,7 @@ def is_exchange_known_ccxt(exchange_name: str, ccxt_module: CcxtModuleType = Non def is_exchange_officially_supported(exchange_name: str) -> bool: - return exchange_name in ['bittrex', 'binance', 'kraken', 'ftx', 'gateio', 'okex'] + return exchange_name in ['bittrex', 'binance', 'kraken', 'ftx', 'gateio', 'okx'] def ccxt_exchanges(ccxt_module: CcxtModuleType = None) -> List[str]: diff --git a/freqtrade/exchange/okex.py b/freqtrade/exchange/okx.py similarity index 84% rename from freqtrade/exchange/okex.py rename to freqtrade/exchange/okx.py index e68ee4a48..8e2cccf46 100644 --- a/freqtrade/exchange/okex.py +++ b/freqtrade/exchange/okx.py @@ -7,8 +7,8 @@ from freqtrade.exchange import Exchange logger = logging.getLogger(__name__) -class Okex(Exchange): - """Okex exchange class. +class Okx(Exchange): + """Okx exchange class. Contains adjustments needed for Freqtrade to work with this exchange. """ diff --git a/tests/exchange/test_ccxt_compat.py b/tests/exchange/test_ccxt_compat.py index 44c664c92..09523bd59 100644 --- a/tests/exchange/test_ccxt_compat.py +++ b/tests/exchange/test_ccxt_compat.py @@ -53,7 +53,7 @@ EXCHANGES = { 'hasQuoteVolume': True, 'timeframe': '5m', }, - 'okex': { + 'okx': { 'pair': 'BTC/USDT', 'stake_currency': 'USDT', 'hasQuoteVolume': True,