feat(family-10): add 16 Ehlers / Cycle (DSP) indicators (#49)

Implements Family 10 (Ehlers / Cycle) end-to-end across Rust core,
Python / Node / WASM bindings, fuzz, tests, benches and docs. This
is an entirely new family covering John Ehlers' digital-signal-
processing school of cycle analytics — a strong differentiator
versus TA-Lib and pandas-ta, which ship only fragments.

Indicators:
- MAMA (Mesa Adaptive MA) — multi-output { mama, fama }
- FAMA (Following Adaptive MA) — scalar wrapper around MAMA's slow line
- Fisher Transform — Gaussian-normalising price transform
- Inverse Fisher Transform — bounded oscillator (tanh-based)
- SuperSmoother — 2-pole Butterworth lowpass
- Roofing Filter — high-pass + SuperSmoother bandpass
- Decycler — price minus 2-pole high-pass (lag-free trend)
- Decycler Oscillator — fast / slow Decycler difference (MACD-like)
- Hilbert Dominant Cycle — phase-derived period estimator [6, 50]
- Sine Wave Indicator — sin(phase) with 45° lead companion
- Adaptive Cycle Indicator — half-period driver for adaptive oscillators
- Center of Gravity Oscillator — weighted-mass momentum
- Cybernetic Cycle Component — EasyLanguage classic
- Empirical Mode Decomposition — bandpass + envelope mean
- Ehlers Stochastic — Stochastic on Roofing Filter input, [-1, +1]
- Instantaneous Trendline — Ehlers 2-pole lag-free trend

Indicator count rises 71 -> 87 across nine families (was eight).

All sixteen pass batch == streaming equivalence, expose the standard
Indicator surface (update / batch / reset / is_ready / warmup_period
/ name), are fuzz-tested, benchmarked against the checked-in BTCUSDT
1-minute dataset and reach across all four bindings.

Wiki deep-dive drafts for every indicator + Sidebar / Overview /
Home / Warmup updates are staged under indicator-ideas/families/
wiki/family-10-ehlers-cycle/ in the main repo (ghost-ignored) for
the maintainer to publish to the wiki repo manually.
This commit is contained in:
kingchenc
2026-05-25 22:14:27 +02:00
committed by GitHub
parent 4f9ed34884
commit 7a18a26daf
34 changed files with 4947 additions and 46 deletions
+71 -7
View File
@@ -19,13 +19,16 @@
use criterion::{criterion_group, criterion_main, BenchmarkId, Criterion, Throughput};
use std::hint::black_box;
use wickra::{
AccelerationBands, AdOscillator, Adxr, Alma, AnchoredVwap, Atr, AtrBands, BatchExt,
BollingerBands, Camarilla, Candle, ClassicPivots, DemandIndex, DemarkPivots, DonchianStop,
DoubleBollinger, Ema, FibonacciPivots, FractalChaosBands, Frama, GarmanKlassVolatility,
HiLoActivator, HurstChannel, Indicator, Jma, Kst, Kvo, LinRegChannel, MaEnvelope,
MacdIndicator, MarketFacilitationIndex, McGinleyDynamic, Nvi, Obv, ParkinsonVolatility,
PercentageTrailingStop, Pgo, Pvi, RenkoTrailingStop, RogersSatchellVolatility, Rsi, Rvi,
RviVolatility, Rwi, Sma, StandardErrorBands, StarcBands, StepTrailingStop, Stochastic, TdCombo,
AccelerationBands, AdOscillator, AdaptiveCycle, Adxr, Alma, AnchoredVwap, Atr, AtrBands,
BatchExt, BollingerBands, Camarilla, Candle, CenterOfGravity, ClassicPivots, CyberneticCycle,
Decycler, DecyclerOscillator, DemandIndex, DemarkPivots, DonchianStop, DoubleBollinger,
EhlersStochastic, Ema, EmpiricalModeDecomposition, Fama, FibonacciPivots, FisherTransform,
FractalChaosBands, Frama, GarmanKlassVolatility, HiLoActivator, HilbertDominantCycle,
HurstChannel, Indicator, InstantaneousTrendline, InverseFisherTransform, Jma, Kst, Kvo,
LinRegChannel, MaEnvelope, MacdIndicator, Mama, MarketFacilitationIndex, McGinleyDynamic, Nvi,
Obv, ParkinsonVolatility, PercentageTrailingStop, Pgo, Pvi, RenkoTrailingStop,
RogersSatchellVolatility, RoofingFilter, Rsi, Rvi, RviVolatility, Rwi, SineWave, Sma,
StandardErrorBands, StarcBands, StepTrailingStop, Stochastic, SuperSmoother, TdCombo,
TdCountdown, TdDeMarker, TdDifferential, TdLines, TdOpen, TdPressure, TdRangeProjection, TdRei,
TdRiskLevel, TdSequential, TdSetup, Tii, Tsv, TtmSqueeze, Vidya, VoltyStop, VolumeOscillator,
VwapStdDevBands, Vzo, WaveTrend, WilliamsFractals, Wma, WoodiePivots, YangZhangVolatility,
@@ -185,6 +188,67 @@ fn benches(c: &mut Criterion) {
bench_candle_input(c, "stochastic", &candles, Stochastic::classic);
bench_candle_input(c, "obv", &candles, Obv::new);
// Family 10 — Ehlers / Cycle scalar benchmarks.
bench_scalar(c, "super_smoother", &closes, || {
SuperSmoother::new(10).unwrap()
});
bench_scalar(c, "fisher_transform", &closes, || {
FisherTransform::new(10).unwrap()
});
bench_scalar(c, "inverse_fisher_transform", &closes, || {
InverseFisherTransform::new(1.0).unwrap()
});
bench_scalar(c, "decycler", &closes, || Decycler::new(20).unwrap());
bench_scalar(c, "decycler_oscillator", &closes, || {
DecyclerOscillator::new(10, 30).unwrap()
});
bench_scalar(c, "roofing_filter", &closes, || {
RoofingFilter::new(10, 48).unwrap()
});
bench_scalar(c, "center_of_gravity", &closes, || {
CenterOfGravity::new(10).unwrap()
});
bench_scalar(c, "cybernetic_cycle", &closes, || {
CyberneticCycle::new(10).unwrap()
});
bench_scalar(c, "instantaneous_trendline", &closes, || {
InstantaneousTrendline::new(20).unwrap()
});
bench_scalar(c, "ehlers_stochastic", &closes, || {
EhlersStochastic::new(20).unwrap()
});
bench_scalar(c, "empirical_mode_decomposition", &closes, || {
EmpiricalModeDecomposition::new(20, 0.5).unwrap()
});
bench_scalar(
c,
"hilbert_dominant_cycle",
&closes,
HilbertDominantCycle::new,
);
bench_scalar(c, "adaptive_cycle", &closes, AdaptiveCycle::new);
bench_scalar(c, "sine_wave", &closes, SineWave::new);
bench_scalar(c, "fama", &closes, || Fama::new(0.5, 0.05).unwrap());
// MAMA: multi-output, mirrored on macd's streaming-only bench style.
{
let mut group = c.benchmark_group("mama");
for &n in SIZES {
let n = n.min(closes.len());
let series = &closes[..n];
group.throughput(Throughput::Elements(n as u64));
group.bench_with_input(BenchmarkId::new("streaming", n), series, |b, prices| {
b.iter(|| {
let mut ind = Mama::classic();
for p in prices {
black_box(ind.update(*p));
}
});
});
}
group.finish();
}
// --- Family 11: DeMark ---
bench_candle_input(c, "td_setup", &candles, TdSetup::classic);
bench_candle_input(c, "td_sequential", &candles, TdSequential::classic);