{"record":{"id":"75c5fafdc9359381","repo":"nautechsystems/nautilus_trader","slug":"unsupported-week-interval-step-w","errorCode":null,"errorMessage":"Unsupported week interval: {step}w","messagePattern":"Unsupported week interval: (.+?)w","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"crates/adapters/binance/src/common/parse.rs","lineNumber":1463,"sourceCode":"            _ => anyhow::bail!(\"Unsupported minute interval: {step}m\"),\n        },\n        BarAggregation::Hour => match step {\n            1 => BinanceKlineInterval::Hour1,\n            2 => BinanceKlineInterval::Hour2,\n            4 => BinanceKlineInterval::Hour4,\n            6 => BinanceKlineInterval::Hour6,\n            8 => BinanceKlineInterval::Hour8,\n            12 => BinanceKlineInterval::Hour12,\n            _ => anyhow::bail!(\"Unsupported hour interval: {step}h\"),\n        },\n        BarAggregation::Day => match step {\n            1 => BinanceKlineInterval::Day1,\n            3 => BinanceKlineInterval::Day3,\n            _ => anyhow::bail!(\"Unsupported day interval: {step}d\"),\n        },\n        BarAggregation::Week => match step {\n            1 => BinanceKlineInterval::Week1,\n            _ => anyhow::bail!(\"Unsupported week interval: {step}w\"),\n        },\n        BarAggregation::Month => match step {\n            1 => BinanceKlineInterval::Month1,\n            _ => anyhow::bail!(\"Unsupported month interval: {step}M\"),\n        },\n        agg => anyhow::bail!(\"Unsupported bar aggregation for Binance: {agg:?}\"),\n    };\n\n    Ok(interval)\n}\n\npub(crate) fn quote_to_l1_deltas(quote: QuoteTick, sequence: u64) -> OrderBookDeltas {\n    let bid_action = if quote.bid_size.is_zero() {\n        BookAction::Delete\n    } else {\n        BookAction::Update\n    };\n    let ask_action = if quote.ask_size.is_zero() {","sourceCodeStart":1445,"sourceCodeEnd":1481,"githubUrl":"https://github.com/nautechsystems/nautilus_trader/blob/a4b06ed870971b5671d12754ea138a3ab99b1dec/crates/adapters/binance/src/common/parse.rs#L1445-L1481","documentation":"bar_spec_to_binance_interval supports week step 1 only, matching Binance's single 1w kline interval. Multi-week steps (2-WEEK, 4-WEEK...) have no native interval and bail with this message.","triggerScenarios":"Requesting Binance bars with a week step greater than 1 — for example a 2-WEEK or monthly-composite bar specification expressed in weeks.","commonSituations":"Bi-weekly/monthly reporting strategies; configs ported from venues with 2w/4w klines; BarType strings authored by multiplying weeks.","solutions":["Remap multi-week bars onto 1-WEEK external bars and aggregate client-side, or use 1-MONTH where the span is a month.","Or use INTERNAL aggregation (e.g. 2-WEEK-LAST-INTERNAL) to keep the exact step locally.","Validate BarType strings in config before startup."],"exampleFix":"// before\n// let bar_type = BarType::from(\"2-WEEK-LAST-EXTERNAL\");\n// -> Unsupported week interval: 2w\n\n// after\n// let bar_type = BarType::from(\"1-WEEK-LAST-EXTERNAL\"); // aggregate two bars client-side","handlingStrategy":"validation","validationCode":"fn supported_week_step(step: u32) -> bool {\n    step == 1\n}","typeGuard":"fn is_supported_week_bar(step: u32) -> bool {\n    step == 1\n}","tryCatchPattern":"let bar_type = BarType::from(\"2-WEEK-LAST-EXTERNAL\");\nif let Err(e) = data_client.subscribe_bars(bar_type) {\n    if e.to_string().contains(\"Unsupported week interval\") {\n        // fall back: 1-WEEK external + client-side aggregation\n    } else {\n        return Err(e);\n    }\n}","preventionTips":["Only week step 1 exists natively; compose multi-week bars from 1-WEEK data.","Prefer 1-MONTH bars for calendar-month spans instead of 4-WEEK.","Validate bar specs centrally at config load."],"tags":["binance","bars","klines","week-interval","barspecification","rust"],"backgroundTag":"unsupported-bar-interval","analyzedSha":"a4b06ed870971b5671d12754ea138a3ab99b1dec","analyzedAt":"2026-08-16T22:54:50.089Z","schemaVersion":2},"datasetVersion":"2026-08-16T23:17:17.608Z"}