From baf4d0ff472cccd2dbfa1b3aa6d37996ffec850f Mon Sep 17 00:00:00 2001 From: kingchenc Date: Tue, 16 Jun 2026 00:51:52 +0200 Subject: [PATCH] fix(data): add missing 3d and 1M Binance kline intervals (#312) Binance supports 16 kline intervals (1s,1m,3m,5m,15m,30m,1h,2h,4h,6h,8h, 12h,1d,3d,1w,1M); the live-binance `Interval` enum listed only 14, missing three-day (`3d`) and one-month (`1M`). Add both variants in Binance order with their wire-format strings, and extend the exhaustive as_str test. --- CHANGELOG.md | 6 ++++++ crates/wickra-data/src/live/binance.rs | 6 ++++++ 2 files changed, 12 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index b459e893..82a2b2b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- **Binance kline feed: add the missing `3d` and `1M` intervals.** The + `live-binance` `Interval` enum was missing three-day (`3d`) and one-month (`1M`) + candles, two of Binance's 16 supported kline intervals. Both are now selectable + and map to the correct wire-format strings. + ### Added - **CSV candle reading in all 10 languages (data layer).** The `CandleReader` parses a `timestamp,open,high,low,close,volume` CSV buffer (a leading UTF-8 BOM diff --git a/crates/wickra-data/src/live/binance.rs b/crates/wickra-data/src/live/binance.rs index 8df1e154..0950bb5e 100644 --- a/crates/wickra-data/src/live/binance.rs +++ b/crates/wickra-data/src/live/binance.rs @@ -92,7 +92,9 @@ pub enum Interval { EightHours, TwelveHours, OneDay, + ThreeDays, OneWeek, + OneMonth, } impl Interval { @@ -112,7 +114,9 @@ impl Interval { Self::EightHours => "8h", Self::TwelveHours => "12h", Self::OneDay => "1d", + Self::ThreeDays => "3d", Self::OneWeek => "1w", + Self::OneMonth => "1M", } } } @@ -413,7 +417,9 @@ mod tests { (Interval::EightHours, "8h"), (Interval::TwelveHours, "12h"), (Interval::OneDay, "1d"), + (Interval::ThreeDays, "3d"), (Interval::OneWeek, "1w"), + (Interval::OneMonth, "1M"), ]; for (iv, expected) in pairs { assert_eq!(iv.as_str(), *expected);