From d03dfb393497fe63b042ebd22d932a0bcabcbfec Mon Sep 17 00:00:00 2001 From: Matthias Date: Sat, 16 Jul 2022 13:12:50 +0200 Subject: [PATCH] Oder cost is real cost (including leverage) --- freqtrade/exchange/exchange.py | 2 +- tests/exchange/test_exchange.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/freqtrade/exchange/exchange.py b/freqtrade/exchange/exchange.py index 7ac45bcc9..43fbbe28b 100644 --- a/freqtrade/exchange/exchange.py +++ b/freqtrade/exchange/exchange.py @@ -822,7 +822,7 @@ class Exchange: 'price': rate, 'average': rate, 'amount': _amount, - 'cost': _amount * rate / leverage, + 'cost': _amount * rate, 'type': ordertype, 'side': side, 'filled': 0, diff --git a/tests/exchange/test_exchange.py b/tests/exchange/test_exchange.py index acd48b3fd..bf4f44440 100644 --- a/tests/exchange/test_exchange.py +++ b/tests/exchange/test_exchange.py @@ -1135,7 +1135,7 @@ def test_create_dry_run_order(default_conf, mocker, side, exchange_name, leverag assert order["symbol"] == "ETH/BTC" assert order["amount"] == 1 assert order["leverage"] == leverage - assert order["cost"] == 1 * 200 / leverage + assert order["cost"] == 1 * 200 @pytest.mark.parametrize("side,startprice,endprice", [