freqtrade/freqtrade · error · RPCException

Can't go short on Spot markets.

Error message

Can't go short on Spot markets.

What it means

Error "Can't go short on Spot markets." thrown in freqtrade/freqtrade.

Source

Thrown at freqtrade/rpc/rpc.py:1142

                logger.warning("force_exit: Invalid argument received")
                raise RPCException("invalid argument")

            result = self.__exec_force_exit(trade, ordertype, amount, price)
            Trade.commit()
            self._freqtrade.wallets.update()
            if not result:
                raise RPCException("Failed to exit trade.")
            return {"result": f"Created exit order for trade {trade_id}."}

    def _force_entry_validations(self, pair: str, order_side: SignalDirection):
        if not self._freqtrade.config.get("force_entry_enable", False):
            raise RPCException("Force_entry not enabled.")

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

        if order_side == SignalDirection.SHORT and self._freqtrade.trading_mode == TradingMode.SPOT:
            raise RPCException("Can't go short on Spot markets.")

        if pair not in self._freqtrade.exchange.get_markets(tradable_only=True):
            raise RPCException("Symbol does not exist or market is not active.")
        # Check if pair quote currency equals to the stake currency.
        stake_currency = self._freqtrade.config.get("stake_currency")
        if not self._freqtrade.exchange.get_pair_quote_currency(pair) == stake_currency:
            raise RPCException(
                f"Wrong pair selected. Only pairs with stake-currency {stake_currency} allowed."
            )

    def _rpc_force_entry(
        self,
        pair: str,
        price: float | None,
        *,
        order_type: str | None = None,
        order_side: SignalDirection = SignalDirection.LONG,
        stake_amount: float | None = None,

View on GitHub (pinned to 1c8edfe4d1)

Solutions

  1. Short positions require futures trading; set 'trading_mode': 'futures' with a supported exchange and margin mode.
  2. On spot markets, only open long positions.

Example fix

Block shorts on spot before entry:
if side == 'short' and self._freqtrade.trading_mode == TradingMode.SPOT:
    raise RPCException("Can't go short on Spot markets.")

When it happens

Trigger: Thrown at freqtrade/rpc/rpc.py:1142 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/564b816e7fc37cb0. Report an issue: GitHub.