fix taker stake amount with leverage

This commit is contained in:
adriance
2022-03-20 20:06:32 +08:00
parent a64ca541a2
commit f01c9cd28c
2 changed files with 4 additions and 7 deletions

View File

@@ -842,7 +842,7 @@ def test_execute_entry(mocker, default_conf_usdt, fee, limit_order,
assert trade
assert trade.open_order_id is None
assert trade.open_rate == 10
assert trade.stake_amount == 100
assert trade.stake_amount == round(order['price'] * order['filled'] / leverage, 8)
# In case of rejected or expired order and partially filled
order['status'] = 'expired'
@@ -860,7 +860,7 @@ def test_execute_entry(mocker, default_conf_usdt, fee, limit_order,
assert trade
assert trade.open_order_id == '555'
assert trade.open_rate == 0.5
assert trade.stake_amount == 15.0
assert trade.stake_amount == round(order['price'] * order['filled'] / leverage, 8)
# Test with custom stake
order['status'] = 'open'