From a50f4d2c57b409345379c71607bde09953af7a21 Mon Sep 17 00:00:00 2001 From: Sam Germain Date: Thu, 3 Feb 2022 18:28:08 -0600 Subject: [PATCH] Exchange.createOrder added * as second param --- freqtrade/exchange/exchange.py | 3 ++- tests/exchange/test_exchange.py | 12 ++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 65f15b98b..b3098d3d4 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -935,6 +935,7 @@ class Exchange: def create_order( self, + *, pair: str, ordertype: str, side: str, @@ -967,7 +968,7 @@ class Exchange: side, amount, rate_for_order, - params + params, ) self._log_exchange_response('create_order', order) order = self._order_contracts_to_amount(order) diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index a3167573c..ad24efc35 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -1271,7 +1271,8 @@ def test_buy_prod(default_conf, mocker, exchange_name): side="buy", amount=1, rate=200, - time_in_force=time_in_force) + time_in_force=time_in_force + ) assert api_mock.create_order.call_args[0][0] == 'ETH/BTC' assert api_mock.create_order.call_args[0][1] == order_type assert api_mock.create_order.call_args[0][2] == 'buy' @@ -2532,7 +2533,14 @@ def test_cancel_order_dry_run(default_conf, mocker, exchange_name): assert exchange.cancel_order(order_id='123', pair='TKN/BTC') == {} assert exchange.cancel_stoploss_order(order_id='123', pair='TKN/BTC') == {} - order = exchange.create_order('ETH/BTC', 'limit', "buy", 5, 0.55, 'gtc') + order = exchange.create_order( + pair='ETH/BTC', + ordertype='limit', + side='buy', + amount=5, + rate=0.55, + time_in_force='gtc', + ) cancel_order = exchange.cancel_order(order_id=order['id'], pair='ETH/BTC') assert order['id'] == cancel_order['id']