Respect max_open_trades when forceentering

closes #7489
This commit is contained in:
Matthias
2022-09-28 09:32:07 +00:00
parent e9abe3cb68
commit fb3d408338
2 changed files with 8 additions and 0 deletions

View File

@@ -773,6 +773,9 @@ class RPC:
is_short = trade.is_short
if not self._freqtrade.strategy.position_adjustment_enable:
raise RPCException(f'position for {pair} already open - id: {trade.id}')
else:
if Trade.get_open_trade_count() >= self._config['max_open_trades']:
raise RPCException("Maximum number of trades is reached.")
if not stake_amount:
# gen stake amount