feat: footprint microstructure indicator (part 4 of 4) (#123)

This commit is contained in:
kingchenc
2026-06-01 20:00:58 +02:00
committed by GitHub
parent 4f11df0e33
commit 3dd7010129
18 changed files with 636 additions and 22 deletions
+11 -1
View File
@@ -11,7 +11,8 @@
use libfuzzer_sys::fuzz_target;
use wickra_core::{
BatchExt, CumulativeVolumeDelta, Indicator, Side, SignedVolume, Trade, TradeImbalance,
BatchExt, CumulativeVolumeDelta, Footprint, Indicator, Side, SignedVolume, Trade,
TradeImbalance,
};
#[inline(never)]
@@ -42,4 +43,13 @@ fuzz_target!(|data: &[u8]| {
drive(SignedVolume::new, &trades);
drive(CumulativeVolumeDelta::new, &trades);
drive(|| TradeImbalance::new(5).unwrap(), &trades);
// Footprint emits a variable-length `FootprintOutput` rather than an `f64`,
// so it is driven directly rather than through the scalar-output helper.
let mut footprint = Footprint::new(0.5).unwrap();
for &trade in &trades {
let _ = footprint.update(trade);
}
footprint.reset();
let _ = Footprint::new(0.5).unwrap().batch(&trades);
});