feat(indicators): B3 Trend & Directional batch (413 -> 420) (#181)

Adds the **B3 — Trend & Directional** batch: seven new indicators, taking the
catalog from 413 to 420 (Trend & Directional family).

| Indicator | Input → Output | Summary |
|-----------|----------------|---------|
| `Qstick` | candle → f64 | Chande's SMA of the candle body (close − open) |
| `TtmTrend` | candle → f64 (±1) | John Carter close-vs-median-SMA trend filter |
| `TrendStrengthIndex` | f64 → f64 | signed r² of an OLS regression of price vs time |
| `PolarizedFractalEfficiency` | f64 → f64 | Hannula directional trend efficiency |
| `WavePm` | f64 → f64 | Kase variance-normalised peak-momentum statistic (reconstruction) |
| `GatorOscillator` | candle → struct | Bill Williams Alligator convergence/divergence histogram |
| `KasePermissionStochastic` | candle → struct | double-smoothed stochastic permission filter |

Note: the roadmap's "Directional Indicator +DI/−DI" item is already covered by
the existing standalone `PlusDi` / `MinusDi` / `Dx`, so it is intentionally not
re-added.

All touchpoints wired: core (every-branch unit tests), Python/Node/WASM
bindings, fuzz drivers, Python test registries + reference tests, Node
factories, README/CHANGELOG counters.

Local verify: `cargo test -p wickra-core` (lib 3389 + doc 378), `cargo clippy
--workspace --all-targets --all-features -- -D warnings`, node build + 495
tests, maturin + 815 pytest, counter 420 == 420.
This commit is contained in:
kingchenc
2026-06-04 17:57:24 +02:00
committed by GitHub
parent ac8f6acf08
commit 13bc801f89
22 changed files with 2711 additions and 61 deletions
+71
View File
@@ -77,6 +77,14 @@ export interface ElderRayValue {
bullPower: number
bearPower: number
}
export interface GatorOscillatorValue {
upper: number
lower: number
}
export interface KasePermissionStochasticValue {
fast: number
slow: number
}
export interface StochValue {
k: number
d: number
@@ -961,6 +969,15 @@ export declare class DynamicMomentumIndex {
isReady(): boolean
warmupPeriod(): number
}
export type TrendStrengthIndexNode = TREND_STRENGTH_INDEX
export declare class TREND_STRENGTH_INDEX {
constructor(period: number)
update(value: number): number | null
batch(prices: Array<number>): Array<number>
reset(): void
isReady(): boolean
warmupPeriod(): number
}
export type JumpIndicatorNode = JumpIndicator
export declare class JumpIndicator {
constructor(period: number, threshold: number)
@@ -1494,6 +1511,60 @@ export declare class ElderRay {
isReady(): boolean
warmupPeriod(): number
}
export type TtmTrendNode = TTM_TREND
export declare class TTM_TREND {
constructor(period: number)
update(high: number, low: number, close: number): number | null
batch(high: Array<number>, low: Array<number>, close: Array<number>): Array<number>
reset(): void
isReady(): boolean
warmupPeriod(): number
}
export type QstickNode = Qstick
export declare class Qstick {
constructor(period: number)
update(open: number, close: number): number | null
batch(open: Array<number>, close: Array<number>): Array<number>
reset(): void
isReady(): boolean
warmupPeriod(): number
}
export type PolarizedFractalEfficiencyNode = POLARIZED_FRACTAL_EFFICIENCY
export declare class POLARIZED_FRACTAL_EFFICIENCY {
constructor(period: number, smoothing: number)
update(value: number): number | null
batch(prices: Array<number>): Array<number>
reset(): void
isReady(): boolean
warmupPeriod(): number
}
export type WavePmNode = WAVE_PM
export declare class WAVE_PM {
constructor(length: number, smoothing: number)
update(value: number): number | null
batch(prices: Array<number>): Array<number>
reset(): void
isReady(): boolean
warmupPeriod(): number
}
export type GatorOscillatorNode = GatorOscillator
export declare class GatorOscillator {
constructor(jawPeriod: number, teethPeriod: number, lipsPeriod: number)
update(high: number, low: number, close: number): GatorOscillatorValue | null
batch(high: Array<number>, low: Array<number>, close: Array<number>): Array<number>
reset(): void
isReady(): boolean
warmupPeriod(): number
}
export type KasePermissionStochasticNode = KasePermissionStochastic
export declare class KasePermissionStochastic {
constructor(length: number, smooth: number)
update(high: number, low: number, close: number): KasePermissionStochasticValue | null
batch(high: Array<number>, low: Array<number>, close: Array<number>): Array<number>
reset(): void
isReady(): boolean
warmupPeriod(): number
}
export type StochNode = Stochastic
export declare class Stochastic {
constructor(kPeriod: number, dPeriod: number)