{"record":{"id":"cd6ca50610e538b3","repo":"nautechsystems/nautilus_trader","slug":"orderlist-denied-no-orders-to-submit","errorCode":null,"errorMessage":"OrderList denied: no orders to submit","messagePattern":"OrderList denied: no orders to submit","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/trading/src/strategy/mod.rs","lineNumber":206,"sourceCode":"    /// Submits an order list.\n    ///\n    /// # Errors\n    ///\n    /// Returns an error if the strategy is not registered, the order list is invalid,\n    /// or order list submission fails.\n    fn submit_order_list(\n        &mut self,\n        mut orders: Vec<OrderAny>,\n        position_id: Option<PositionId>,\n        client_id: Option<ClientId>,\n        params: Option<Params>,\n    ) -> anyhow::Result<()>\n    where\n        Self: StrategyNative,\n    {\n        if orders.is_empty() {\n            log::error!(\"OrderList denied: no orders to submit\");\n            anyhow::bail!(\"OrderList denied: no orders to submit\");\n        }\n\n        for order in &orders {\n            if order.status() != OrderStatus::Initialized {\n                anyhow::bail!(\n                    \"Order in list denied: invalid status for {}, expected INITIALIZED\",\n                    order.client_order_id()\n                );\n            }\n        }\n\n        let first_venue = orders[0].instrument_id().venue;\n        for order in &orders {\n            if order.instrument_id().venue != first_venue {\n                anyhow::bail!(\n                    \"OrderList denied: orders must share the same venue; \\\n                     expected {first_venue}, found {} on {}\",\n                    order.instrument_id().venue,","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/trading/src/strategy/mod.rs#L188-L224","documentation":"submit_order_list refuses to process an empty order list. An OrderList must contain at least one INITIALIZED order, so an empty collection is rejected up front with an error log and bail instead of creating an empty list in the cache.","triggerScenarios":"Calling strategy.submit_order_list with an empty orders sequence — typically when orders were built conditionally and no condition matched.","commonSituations":"Filter logic producing zero orders at runtime; a upstream signal/batch that returned no entries; refactor that moved order creation after the submit call.","solutions":["Check the list length before calling and skip submission when empty.","Ensure at least one order is created via the order factory before building the list.","Log or handle the empty-batch case explicitly in the calling code."],"exampleFix":"// before\nself.submit_order_list(OrderList(orders))\n\n// after\nif orders:\n    self.submit_order_list(OrderList(orders))","handlingStrategy":"validation","validationCode":"if not orders:\n    return  # nothing to submit; skip instead of raising","typeGuard":"def is_nonempty_order_list(orders) -> bool:\n    return isinstance(orders, (list, tuple)) and len(orders) > 0","tryCatchPattern":"try:\n    self.submit_order_list(order_list)\nexcept RuntimeError as e:\n    if \"no orders to submit\" in str(e):\n        self.log.warning(\"skipped empty order list\")\n    else:\n        raise","preventionTips":["Guard every submit_order_list call site with a length check","Fail fast with an explicit log when conditional order building yields zero orders","Keep order creation and submission in the same code path so batches cannot drift to empty"],"tags":["rust","strategy","order-submission","empty-list"],"backgroundTag":"empty-required-field","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"}