{"record":{"id":"aac93687e3e599c0","repo":"nautechsystems/nautilus_trader","slug":"venue-venue-name-has-book-type-but-no-ord","errorCode":null,"errorMessage":"Venue '{venue_name}' has book_type {:?} but no order book data configured","messagePattern":"Venue '(.+?)' has book_type (.+?) but no order book data configured","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/backtest/src/node.rs","lineNumber":373,"sourceCode":"            );\n\n            if needs_book_data {\n                let venue_name = venue_config.name().to_string();\n                let has_book_data = config.data().iter().any(|dc| {\n                    let is_book_type = matches!(\n                        dc.data_type(),\n                        NautilusDataType::OrderBookDelta | NautilusDataType::OrderBookDepth10\n                    );\n\n                    if !is_book_type {\n                        return false;\n                    }\n\n                    // Unfiltered config (no instrument filter) covers all venues\n                    let ids = dc.get_instrument_ids().unwrap_or_default();\n                    ids.is_empty() || ids.iter().any(|id| id.venue.to_string() == venue_name)\n                });\n                anyhow::ensure!(\n                    has_book_data,\n                    \"Venue '{venue_name}' has book_type {:?} but no order book data configured\",\n                    venue_config.book_type()\n                );\n            }\n        }\n    }\n    Ok(())\n}\n\nfn run_oneshot(engine: &mut BacktestEngine, config: &BacktestRunConfig) -> anyhow::Result<()> {\n    for data_config in config.data() {\n        let data = load_data(data_config, config.start(), config.end())?;\n        if data.is_empty() {\n            log::warn!(\"No data found for config: {:?}\", data_config.data_type());\n            continue;\n        }\n        engine.add_data(data, data_config.client_id(), false, false)?;","sourceCodeStart":355,"sourceCodeEnd":391,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/backtest/src/node.rs#L355-L391","documentation":"A venue is configured with a non-null order book type (e.g. L1/L2/L3), but no order book data (data config covering book/quote data for that venue) was added to the backtest. The engine validates that any venue declaring a book type can actually be fed book data.","triggerScenarios":"Calling BacktestNode::new with a venue configured with book_type L1_MBP/L2_MBP/L3_MBP while no data config with book data (or no data config whose instrument IDs include that venue) was added via add_data.","commonSituations":"Configuring book_type for a venue but forgetting to load/order L1 or L2 book data; data added only for other venues; instrument-filtered data configs that exclude the venue's instruments so the coverage check fails.","solutions":["Add order book data for the venue via node.add_data(...) with a data config covering the venue's instruments.","If no book modeling is needed, change the venue's book_type to NoBook (or omit it) in the venue config.","Check that the data config's instrument filter is not empty/excluding the venue's instrument IDs."],"exampleFix":"// before\nnode.add_venue(venue_builder().book_type(BookType::L2_MBP)); // no book data added\n// after\nnode.add_venue(venue_builder().book_type(BookType::L2_MBP));\nnode.add_data(book_l2_data_for_venue());","handlingStrategy":"validation","validationCode":"# python side, before building the node\nfor venue_cfg in venue_configs:\n    if venue_cfg.book_type != BookType.NO_BOOK:\n        assert any(d.covers_book_data_for(venue_cfg.name) for d in data_configs), \\\n            f\"venue {venue_cfg.name} needs book data\"\n","typeGuard":null,"tryCatchPattern":"try:\n    node = BacktestNode(config)\nexcept ValueError as e:\n    if \"no order book data configured\" in str(e):\n        raise SystemExit(f\"Add book data or set book_type=NO_BOOK: {e}\")\n    raise\n","preventionTips":["Only set book_type when you actually add L1/L2 book data for that venue.","Default venue configs to BookType.NO_BOOK unless book simulation is required.","Keep data-loading and venue-config code adjacent so the pairing is visible in review."],"tags":["backtest","config","order-book","venue"],"backgroundTag":"missing-required-config-field","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"}