Fix stake-amount handling for dry-run

This commit is contained in:
Matthias
2022-03-05 15:53:40 +01:00
parent 0bac7f824e
commit 76e5d5b232
3 changed files with 11 additions and 8 deletions

View File

@@ -779,7 +779,7 @@ class Exchange:
'price': rate,
'average': rate,
'amount': _amount,
'cost': _amount * rate,
'cost': _amount * rate / leverage,
'type': ordertype,
'side': side,
'filled': 0,

View File

@@ -102,8 +102,7 @@ class Wallets:
for position in open_trades:
# size = self._exchange._contracts_to_amount(position.pair, position['contracts'])
size = position.amount
# TODO-lev: stake_amount in real trades does not include the leverage ...
collateral = position.stake_amount / position.leverage
collateral = position.stake_amount
leverage = position.leverage
tot_in_trades -= collateral
_positions[position.pair] = PositionWallet(