Fix failing api when max_open_trades is unlimited

This commit is contained in:
Matthias
2021-01-12 19:24:37 +01:00
parent 60ea32e398
commit ac43591c44
2 changed files with 10 additions and 4 deletions

View File

@@ -649,7 +649,8 @@ class RPC:
trades = Trade.get_open_trades()
return {
'current': len(trades),
'max': float(self._freqtrade.config['max_open_trades']),
'max': (int(self._freqtrade.config['max_open_trades'])
if self._freqtrade.config['max_open_trades'] != float('inf') else -1),
'total_stake': sum((trade.open_rate * trade.amount) for trade in trades)
}