{"record":{"id":"ca521fe50ae35ea6","repo":"freqtrade/freqtrade","slug":"no-active-trade","errorCode":null,"errorMessage":"no active trade","messagePattern":"no active trade","errorType":"exception","errorClass":"RPCException","httpStatus":null,"severity":"error","filePath":"freqtrade/rpc/rpc.py","lineNumber":207,"sourceCode":"                if config.get(\"max_entry_position_adjustment\") != float(\"inf\")\n                else -1\n            ),\n        }\n        return val\n\n    def _rpc_trade_status(self, trade_ids: list[int] | None = None) -> list[dict[str, Any]]:\n        \"\"\"\n        Below follows the RPC backend it is prefixed with rpc_ to raise awareness that it is\n        a remotely exposed function\n        \"\"\"\n        # Fetch open trades\n        if trade_ids:\n            trades: Sequence[Trade] = Trade.get_trades(trade_filter=Trade.id.in_(trade_ids)).all()\n        else:\n            trades = Trade.get_open_trades()\n\n        if not trades:\n            raise RPCException(\"no active trade\")\n        else:\n            results = []\n            for trade in trades:\n                current_profit_fiat: float | None = None\n                total_profit_fiat: float | None = None\n\n                # prepare open orders details\n                oo_details: str | None = \"\"\n                oo_details_lst = [\n                    f\"({oo.order_type} {oo.side} rem={oo.safe_remaining:.8f})\"\n                    for oo in trade.open_orders\n                    if oo.ft_order_side not in [\"stoploss\"]\n                ]\n                oo_details = \", \".join(oo_details_lst)\n\n                total_profit_abs = 0.0\n                total_profit_ratio: float | None = None\n                # calculate profit and send message to user","sourceCodeStart":189,"sourceCodeEnd":225,"githubUrl":"https://github.com/freqtrade/freqtrade/blob/1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15/freqtrade/rpc/rpc.py#L189-L225","documentation":"Error \"no active trade\" thrown in freqtrade/freqtrade.","triggerScenarios":"Thrown at freqtrade/rpc/rpc.py:207 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["There is no open trade for the requested pair; open a trade first or query the status of open trades.","Verify the pair has an active position before calling forceexit or trade-specific RPC commands."],"exampleFix":"Check for an active trade first:\ntrade = Trade.get_open_trade()\nif not trade:\n    raise RPCException('no active trade')","handlingStrategy":null,"validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"1c8edfe4d1e8d11bd4b40e8fc3237c26c3a60e15","analyzedAt":"2026-08-15T05:09:08.096Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}