{"record":{"id":"145aded75fb33fd9","repo":"nautechsystems/nautilus_trader","slug":"unknown-ib-historical-tick-type-value","errorCode":null,"errorMessage":"Unknown IB historical tick type: {value}","messagePattern":"Unknown IB historical tick type: (.+?)","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/adapters/interactive_brokers/src/common/enums/market_data.rs","lineNumber":59,"sourceCode":"impl IbHistoricalTickType {\n    /// Returns the IB wire string.\n    #[must_use]\n    pub const fn as_str(self) -> &'static str {\n        match self {\n            Self::Trades => \"TRADES\",\n            Self::BidAsk => \"BID_ASK\",\n        }\n    }\n}\n\nimpl FromStr for IbHistoricalTickType {\n    type Err = anyhow::Error;\n\n    fn from_str(value: &str) -> Result<Self, Self::Err> {\n        match value.to_ascii_uppercase().as_str() {\n            \"TRADES\" => Ok(Self::Trades),\n            \"BID_ASK\" => Ok(Self::BidAsk),\n            _ => anyhow::bail!(\"Unknown IB historical tick type: {value}\"),\n        }\n    }\n}\n\nimpl Display for IbHistoricalTickType {\n    fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {\n        f.write_str(self.as_str())\n    }\n}\n\n/// Interactive Brokers trading hours selector.\n#[derive(Debug, Clone, Copy, PartialEq, Eq)]\n#[cfg_attr(\n    feature = \"python\",\n    pyo3::pyclass(\n        module = \"nautilus_trader.adapters.interactive_brokers\",\n        from_py_object,\n        rename_all = \"SCREAMING_SNAKE_CASE\"","sourceCodeStart":41,"sourceCodeEnd":77,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/18893faf8b356be3320add8de2f861b0b647cf06/crates/adapters/interactive_brokers/src/common/enums/market_data.rs#L41-L77","documentation":"IbHistoricalTickType::from_str parses a historical data request's bar-what-to-show/tick type into the adapter enum, which currently only accepts \"TRADES\" and \"BID_ASK\" (case-insensitive). Any other string bails. It ensures the adapter only receives historical data kinds it can convert into Nautilus data types.","triggerScenarios":"Requesting IB historical data with whatToShow values like \"BID\", \"ASK\", \"MIDPOINT\", \"ADJUSTED_LAST\", \"OPTION_IMPLIED_VOLATILITY\", etc., then converting via IbHistoricalTickType::from_str/parse; passing lowercase variants is fine, but any unsupported keyword bails.","commonSituations":"Configuring a historical data request/market data subscription in a Nautilus config with a whatToShow string valid on the IB API but not yet supported by the adapter; switching between adapters and reusing another adapter's enum values; typos such as \"TRADE\" instead of \"TRADES\".","solutions":["Use one of the supported values: \"TRADES\" or \"BID_ASK\" (case-insensitive) in your request/config.","Check the adapter's supported list in crates/adapters/interactive_brokers/src/common/enums/market_data.rs and, if you need e.g. MIDPOINT, add a variant plus conversion mapping.","For BID/ASK/MIDPOINT history, either switch to BID_ASK or file/prepare an adapter extension."],"exampleFix":"// before\nlet tick_type: IbHistoricalTickType = \"MIDPOINT\".parse()?; // not supported\n// after\nlet tick_type: IbHistoricalTickType = \"BID_ASK\".parse()?; // supported value","handlingStrategy":"validation","validationCode":"const SUPPORTED_HIST_TICK_TYPES: &[&str] = &[\"TRADES\", \"BID_ASK\"];\nfn is_supported_hist_tick_type(v: &str) -> bool { SUPPORTED_HIST_TICK_TYPES.contains(&v.to_ascii_uppercase().as_str()) }","typeGuard":"fn as_ib_hist_tick_type(v: &str) -> Option<IbHistoricalTickType> {\n    use std::str::FromStr;\n    IbHistoricalTickType::from_str(v).ok()\n}","tryCatchPattern":"match what_to_show.parse::<IbHistoricalTickType>() {\n    Ok(t) => request_history(t),\n    Err(e) => return Err(anyhow::anyhow!(\"unsupported whatToShow: {e}; use TRADES or BID_ASK\")),\n}","preventionTips":["Constrain whatToShow in your request/config type to the adapter's supported enum instead of free-form strings.","Check the adapter docs for supported historical tick types before configuring MIDPOINT/BID/ASK requests."],"tags":["rust","enum-parsing","interactive-brokers","market-data"],"backgroundTag":"invalid-enum-value","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"}