{"record":{"id":"c5b6a4c032725ad6","repo":"nautechsystems/nautilus_trader","slug":"orderlist-denied-e","errorCode":null,"errorMessage":"OrderList denied: {e}","messagePattern":"OrderList denied: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/trading/src/strategy/mod.rs","lineNumber":259,"sourceCode":"            return Ok(());\n        }\n\n        let core = StrategyNative::strategy_core_mut(self);\n\n        let trader_id = registered_trader_id(core)?;\n        let strategy_id = registered_strategy_id(core)?;\n        let ts_init = core.clock_mut().timestamp_ns();\n\n        // TODO: Replace with fluent builder API for order list construction\n        let order_list = if orders.first().is_some_and(|o| o.order_list_id().is_some()) {\n            OrderList::from_orders(&orders, ts_init)\n        } else {\n            core.order_factory().create_list(&mut orders, ts_init)\n        };\n\n        if let Err(e) = order_list.validate() {\n            log::error!(\"OrderList denied: {e}\");\n            anyhow::bail!(\"OrderList denied: {e}\");\n        }\n\n        {\n            let cache_rc = core.cache_rc();\n            let mut cache = cache_rc.try_borrow_mut().map_err(|_| {\n                anyhow::anyhow!(\n                    \"Cannot submit order list {}: cache is currently borrowed\",\n                    order_list.id\n                )\n            })?;\n\n            if cache.order_list_exists(&order_list.id) {\n                anyhow::bail!(\"OrderList denied: duplicate {}\", order_list.id);\n            }\n\n            for order in &orders {\n                if cache.order_exists(&order.client_order_id()) {\n                    anyhow::bail!(","sourceCodeStart":241,"sourceCodeEnd":277,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/trading/src/strategy/mod.rs#L241-L277","documentation":"After construction, the OrderList is validated via order_list.validate(); if the list is internally inconsistent (e.g. invalid quantities/prices, or missing parameters for composite list types like bracket/OCO), submit_order_list logs and bails with the embedded validation message.","triggerScenarios":"Submitting a list whose validate() fails — commonly a bracket list created with missing/invalid stop or limit parameters, or hand-constructed lists with inconsistent fields.","commonSituations":"Malformed bracket/OTO/OCO construction parameters passed to the order factory; custom order building that bypasses factory invariants; quantity/price fields left unset or negative.","solutions":["Read the embedded validation message ({e}) — it names the exact violated constraint.","Build lists via the order factory's list creators (bracket, OTO, OCO) with complete, valid parameters.","Validate quantities/prices are set and positive before calling submit_order_list."],"exampleFix":"// before\nbracket = self.order_factory.bracket(limit_order)  # missing stop params\n\n// after\nbracket = self.order_factory.bracket(\n    limit_order,\n    stop_side=OrderSide.SELL,\n    stop_trigger_price=stop_px,\n    stop_quantity=qty,\n)","handlingStrategy":"validation","validationCode":"for o in orders:\n    if o.quantity <= 0 or (hasattr(o, 'price') and o.price is not None and o.price <= 0):\n        raise ValueError(f\"invalid order parameters: {o.client_order_id}\")","typeGuard":"def list_params_complete(orders) -> bool:\n    return bool(orders) and all(getattr(o, 'quantity', None) for o in orders)","tryCatchPattern":"try:\n    self.submit_order_list(order_list)\nexcept RuntimeError as e:\n    if e.args and \"OrderList denied\" in str(e.args[0]):\n        self.log.error(f\"order list failed validation: {e}\")\n    else:\n        raise","preventionTips":["Read the embedded validation message — it names the exact violated constraint","Build composite lists (bracket/OTO/OCO) via the order factory with all required parameters","Validate quantities and prices are set and positive before submission"],"tags":["rust","strategy","order-submission","validation"],"backgroundTag":"schema-validation-failed","analyzedSha":"18893faf8b356be3320add8de2f861b0b647cf06","analyzedAt":"2026-09-08T20:49:34.690Z","contentChangedAt":"2026-09-08T20:49:34.690Z","schemaVersion":2},"datasetVersion":"2026-09-14T05:17:10.506Z"}