{"record":{"id":"b526332807d61e53","repo":"nautechsystems/nautilus_trader","slug":"trigger-conditional-orders-order-type-are-no-b52633","errorCode":null,"errorMessage":"Trigger/conditional orders ({order_type:?}) are not supported for OKX options","messagePattern":"Trigger/conditional orders \\((.+?)\\) are not supported for OKX options","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/okx/src/execution.rs","lineNumber":651,"sourceCode":"    fn is_conditional_order(&self, order_type: OrderType) -> bool {\n        OKX_CONDITIONAL_ORDER_TYPES.contains(&order_type)\n    }\n\n    fn submit_order_route(\n        &self,\n        instrument_id: InstrumentId,\n        order_type: OrderType,\n    ) -> anyhow::Result<OrderCommandRoute> {\n        if self.is_conditional_order(order_type) {\n            if is_spread_instrument(instrument_id) {\n                anyhow::bail!(\n                    \"Trigger/conditional orders ({order_type:?}) are not supported for OKX spreads\"\n                );\n            }\n\n            let inst_type = okx_instrument_type_from_symbol(instrument_id.symbol.as_str());\n            if inst_type == OKXInstrumentType::Option {\n                anyhow::bail!(\n                    \"Trigger/conditional orders ({order_type:?}) are not supported for OKX options\"\n                );\n            }\n\n            return Ok(OrderCommandRoute::AlgoHttp);\n        }\n\n        if is_spread_instrument(instrument_id) {\n            Ok(OrderCommandRoute::SpreadHttp)\n        } else {\n            Ok(OrderCommandRoute::RegularWs)\n        }\n    }\n\n    fn cancel_order_route(\n        &self,\n        instrument_id: InstrumentId,\n        order_state: Option<(OrderType, Option<bool>)>,","sourceCodeStart":633,"sourceCodeEnd":669,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/okx/src/execution.rs#L633-L669","documentation":"Conditional/trigger (algo) orders are not supported for OKX options in this adapter. When the order type is conditional and the instrument resolves to `OKXInstrumentType::Option`, `submit_order_route` bails rather than routing to the algo HTTP endpoint. The adapter only routes conditional orders via `OrderCommandRoute::AlgoHttp` for non-option, non-spread instruments.","triggerScenarios":"Calling `submit_order` with a conditional order type (`is_conditional_order` true, e.g. `StopMarket`, `LimitIfTouched`) where `okx_instrument_type_from_symbol(instrument_id.symbol)` is `OKXInstrumentType::Option`.","commonSituations":"Adding stop-loss protection to an options position on OKX; reusing an options strategy config that worked on another venue which supports options trigger orders.","solutions":["Submit plain LIMIT/MARKET options orders and manage stop logic in the strategy itself.","Hedge or protect the options position at the underlying (e.g. perp/futures) level with supported conditional orders.","Check `okx_instrument_type_from_symbol` on your symbol to confirm you are not accidentally targeting an option."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if is_conditional_order(order_type)\n    && okx_instrument_type_from_symbol(instrument_id.symbol.as_str()) == OKXInstrumentType::Option {\n    return Err(anyhow::anyhow!(\"Conditional orders unsupported for OKX options\"));\n}\nclient.submit_order(order)?;","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Gate conditional-order submission on instrument type for OKX.","Manage option stop-loss at the underlying level where algo orders are supported.","Verify symbol -> instrument type mapping in tests before live deployment."],"tags":["okx","options","conditional-order","unsupported-operation"],"backgroundTag":"unsupported-operation","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}