feat: add 7 alt-chart bar builders (B19) (#220)
Adds seven information-driven bar builders to the **Alt-Chart Bars** family, the final batch of the family-deepening run. Indicator count **507 → 514**. ## Builders All implement the `BarBuilder` trait (`update(Candle) -> Vec<Bar>`), emitting a data-dependent number of completed bars per candle. | Builder | Driver | Bar fields | |---------|--------|-----------| | `RangeBars` | close | open, close, direction | | `TickBars` | OHLCV | open, high, low, close, volume | | `VolumeBars` | OHLCV | open, high, low, close, volume | | `DollarBars` (Lopez de Prado) | OHLCV | + dollar | | `ImbalanceBars` | OHLC | + imbalance, direction | | `RunBars` | OHLC | + length, direction | | `ThreeLineBreakBars` | close | open, close, direction | ## Touchpoints Seven core modules (each with full unit tests), `mod.rs`/`lib.rs` (builders counted, bar element types on their own re-export lines), README family rows, Python/Node/WASM hand-written bindings for the variable-length output (Python tuples + `(k, N)` ndarray; Node `Vec<object>`; WASM array of objects), the `bar_builder_update_candle` fuzz target, dedicated Python + Node tests, the `BAR_BUILDERS` completeness exclusion, and CHANGELOG. ## Verification - `cargo test -p wickra-core --lib` — 4207 passed - `cargo test -p wickra-core --doc` — 464 passed - `cargo clippy --workspace --all-targets --all-features -- -D warnings` — clean - `npm test` (node) — 584 passed - `pytest` (python) — 957 passed
This commit is contained in:
@@ -11,7 +11,7 @@
|
||||
//! and zero ranges within that band.
|
||||
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use wickra_core::{BarBuilder, Candle, KagiBars, PointAndFigureBars, RenkoBars};
|
||||
use wickra_core::{BarBuilder, Candle, DollarBars, ImbalanceBars, KagiBars, PointAndFigureBars, RangeBars, RenkoBars, RunBars, ThreeLineBreakBars, TickBars, VolumeBars};
|
||||
|
||||
/// Reinterpret the fuzz bytes as `[open, high, low, close, volume]` groups,
|
||||
/// keeping only structurally-valid candles whose magnitudes stay in a band that
|
||||
@@ -40,6 +40,13 @@ fuzz_target!(|data: Vec<f64>| {
|
||||
drive(RenkoBars::new(5.0).unwrap(), &candles);
|
||||
drive(KagiBars::new(5.0).unwrap(), &candles);
|
||||
drive(PointAndFigureBars::new(5.0, 3).unwrap(), &candles);
|
||||
drive(RangeBars::new(2.0).unwrap(), &candles);
|
||||
drive(TickBars::new(5).unwrap(), &candles);
|
||||
drive(VolumeBars::new(100.0).unwrap(), &candles);
|
||||
drive(DollarBars::new(10000.0).unwrap(), &candles);
|
||||
drive(ImbalanceBars::new(5.0).unwrap(), &candles);
|
||||
drive(RunBars::new(3).unwrap(), &candles);
|
||||
drive(ThreeLineBreakBars::new(3).unwrap(), &candles);
|
||||
|
||||
let _ = RenkoBars::new(5.0).unwrap().batch(&candles);
|
||||
let _ = KagiBars::new(5.0).unwrap().batch(&candles);
|
||||
|
||||
Reference in New Issue
Block a user