feat(breadth): complete the Market Breadth family (14 indicators) (#157)
Completes expansion-roadmap block **A2 — Market Breadth**: the 14 indicators that remained after the `AdvanceDecline` bootstrap, all built on the existing `CrossSection` input. ## Indicators (all scalar `Indicator<Input = CrossSection, Output = f64>`) | Indicator | Reading | |-----------|---------| | `AdvanceDeclineRatio` | advancers / decliners | | `AdVolumeLine` | cumulative net advancing volume | | `McClellanOscillator` | 19/39 EMAs of ratio-adjusted net advances | | `McClellanSummationIndex` | running total of the oscillator | | `Trin` (Arms Index) | A/D ratio over up/down volume ratio | | `BreadthThrust` (Zweig) | SMA of the advancing-issues share | | `NewHighsNewLows` | new highs − new lows | | `HighLowIndex` | SMA of the record-high percent | | `PercentAboveMa` | % of the universe above its MA | | `UpDownVolumeRatio` | advancing / declining volume | | `BullishPercentIndex` | % on a point-and-figure buy signal | | `CumulativeVolumeIndex` | volume-normalised cumulative net advancing volume | | `AbsoluteBreadthIndex` | \|advancers − decliners\| | | `TickIndex` | instantaneous net advancers − decliners | ## Input model `AdVolumeLine` and `CumulativeVolumeIndex` are kept distinct (the latter normalises each tick's net advancing volume by total volume, so it stays comparable across volume regimes). `PercentAboveMa` and `BullishPercentIndex` need a per-symbol state signal that `Member` did not carry, so `Member` gains two additive flags (`above_ma`, `on_buy_signal`) via a new `Member::with_signals` constructor; the 4-arg `Member::new` leaves both cleared, so every existing caller and binding is unchanged. `CrossSection` gains volume / new-extreme / state aggregation helpers. ## Wiring Fully wired across the Rust core, the python/node/wasm bindings, the cross-section fuzz target, the README + docs indicator counters (325 → 339), and dedicated python/node streaming-vs-batch tests. `fmt` / `test --workspace --all-features` / `clippy --workspace -D warnings` / node build+test / pytest all green locally.
This commit is contained in:
@@ -12,7 +12,7 @@
|
||||
//! streaming or batched.
|
||||
|
||||
use libfuzzer_sys::fuzz_target;
|
||||
use wickra_core::{AdvanceDecline, BatchExt, CrossSection, Indicator, Member};
|
||||
use wickra_core::{AbsoluteBreadthIndex, AdVolumeLine, AdvanceDecline, AdvanceDeclineRatio, BatchExt, BreadthThrust, BullishPercentIndex, CrossSection, CumulativeVolumeIndex, HighLowIndex, Indicator, McClellanOscillator, McClellanSummationIndex, Member, NewHighsNewLows, PercentAboveMa, TickIndex, Trin, UpDownVolumeRatio};
|
||||
|
||||
#[inline(never)]
|
||||
fn drive<I>(make: impl Fn() -> I, sections: &[CrossSection])
|
||||
@@ -44,4 +44,18 @@ fuzz_target!(|data: &[u8]| {
|
||||
.collect();
|
||||
|
||||
drive(AdvanceDecline::new, §ions);
|
||||
drive(AdvanceDeclineRatio::new, §ions);
|
||||
drive(AdVolumeLine::new, §ions);
|
||||
drive(McClellanOscillator::new, §ions);
|
||||
drive(McClellanSummationIndex::new, §ions);
|
||||
drive(Trin::new, §ions);
|
||||
drive(|| BreadthThrust::new(10).unwrap(), §ions);
|
||||
drive(NewHighsNewLows::new, §ions);
|
||||
drive(|| HighLowIndex::new(10).unwrap(), §ions);
|
||||
drive(PercentAboveMa::new, §ions);
|
||||
drive(UpDownVolumeRatio::new, §ions);
|
||||
drive(BullishPercentIndex::new, §ions);
|
||||
drive(CumulativeVolumeIndex::new, §ions);
|
||||
drive(AbsoluteBreadthIndex::new, §ions);
|
||||
drive(TickIndex::new, §ions);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user