freqtrade/freqtrade · error · RPCException

trader is not running

Error message

trader is not running

What it means

Error "trader is not running" thrown in freqtrade/freqtrade.

Source

Thrown at freqtrade/rpc/rpc.py:1101

            return True
        return False

    def _rpc_force_exit(
        self,
        trade_id: str,
        ordertype: str | None = None,
        *,
        amount: float | None = None,
        price: float | None = None,
    ) -> dict[str, str]:
        """
        Handler for forceexit <id>.
        exits the given trade. Uses current price if price is None.
        """

        if self._freqtrade.state == State.STOPPED:
            raise RPCException("trader is not running")

        with self._freqtrade._exit_lock:
            if trade_id == "all":
                # Execute exit for all open orders
                for trade in Trade.get_open_trades():
                    self.__exec_force_exit(trade, ordertype)
                Trade.commit()
                self._freqtrade.wallets.update()
                return {"result": "Created exit orders for all open trades."}

            # Query for trade
            trade = (
                Trade.get_trades(
                    trade_filter=[
                        Trade.id == int(trade_id),
                        Trade.is_open.is_(True),
                    ]
                ).first()

View on GitHub (pinned to 1c8edfe4d1)

Solutions

  1. Start the freqtrade bot (trader) before issuing trading RPC commands.
  2. Check that the bot process is running and in the 'running' state, not stopped.

Example fix

Check worker state first:
if not self._freqtrade.state == State.RUNNING:
    raise RPCException('trader is not running')

When it happens

Trigger: Thrown at freqtrade/rpc/rpc.py:1101 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of freqtrade/freqtrade@1c8edfe4d1 (2026-08-15). Data as JSON: /api/errors/9e268a3712f64a0c. Report an issue: GitHub.