feat: allow force_exit, rpc_cancel_open_order and _rpc_count in paused state

This commit is contained in:
Axel-CH
2025-03-23 15:25:34 -04:00
parent 53bd2d71a0
commit 16576d37b1

View File

@@ -933,7 +933,7 @@ class RPC:
Sells the given trade at current price Sells the given trade at current price
""" """
if self._freqtrade.state != State.RUNNING: if self._freqtrade.state == State.STOPPED:
raise RPCException("trader is not running") raise RPCException("trader is not running")
with self._freqtrade._exit_lock: with self._freqtrade._exit_lock:
@@ -1049,7 +1049,7 @@ class RPC:
raise RPCException(f"Failed to enter position for {pair}.") raise RPCException(f"Failed to enter position for {pair}.")
def _rpc_cancel_open_order(self, trade_id: int): def _rpc_cancel_open_order(self, trade_id: int):
if self._freqtrade.state != State.RUNNING: if self._freqtrade.state == State.STOPPED:
raise RPCException("trader is not running") raise RPCException("trader is not running")
with self._freqtrade._exit_lock: with self._freqtrade._exit_lock:
# Query for trade # Query for trade
@@ -1217,7 +1217,7 @@ class RPC:
def _rpc_count(self) -> dict[str, float]: def _rpc_count(self) -> dict[str, float]:
"""Returns the number of trades running""" """Returns the number of trades running"""
if self._freqtrade.state != State.RUNNING: if self._freqtrade.state == State.STOPPED:
raise RPCException("trader is not running") raise RPCException("trader is not running")
trades = Trade.get_open_trades() trades = Trade.get_open_trades()