From 68bc2a610743374978a37f767dc3787a4f9b5584 Mon Sep 17 00:00:00 2001 From: Matthias Date: Sun, 27 Feb 2022 11:56:22 +0100 Subject: [PATCH] Add huobi to ccxt compat tests --- freqtrade/exchange/huobi.py | 2 ++ tests/exchange/test_ccxt_compat.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/freqtrade/exchange/huobi.py b/freqtrade/exchange/huobi.py index 71c69a9a2..d07e13497 100644 --- a/freqtrade/exchange/huobi.py +++ b/freqtrade/exchange/huobi.py @@ -18,6 +18,8 @@ class Huobi(Exchange): "stoploss_on_exchange": True, "stoploss_order_types": {"limit": "stop-limit"}, "ohlcv_candle_limit": 1000, + "l2_limit_range": [5, 10, 20], + "l2_limit_range_required": False, } def stoploss_adjust(self, stop_loss: float, order: Dict) -> bool: diff --git a/tests/exchange/test_ccxt_compat.py b/tests/exchange/test_ccxt_compat.py index 09523bd59..877d53fe7 100644 --- a/tests/exchange/test_ccxt_compat.py +++ b/tests/exchange/test_ccxt_compat.py @@ -59,6 +59,12 @@ EXCHANGES = { 'hasQuoteVolume': True, 'timeframe': '5m', }, + 'huobi': { + 'pair': 'BTC/USDT', + 'stake_currency': 'USDT', + 'hasQuoteVolume': True, + 'timeframe': '5m', + }, 'bitvavo': { 'pair': 'BTC/EUR', 'stake_currency': 'EUR', @@ -140,7 +146,10 @@ class TestCCXTExchange(): else: next_limit = exchange.get_next_limit_in_list( val, l2_limit_range, l2_limit_range_required) - if next_limit is None or next_limit > 200: + if next_limit is None: + assert len(l2['asks']) > 100 + assert len(l2['asks']) > 100 + elif next_limit > 200: # Large orderbook sizes can be a problem for some exchanges (bitrex ...) assert len(l2['asks']) > 200 assert len(l2['asks']) > 200