feat: add 19 indicators for external feature-extractor coverage (377 -> 396)#175
Merged
Conversation
Add six Price Statistics indicators so downstream feature extractors can
replace hand-built equivalents with native streaming ones:
- LogReturn — ln(price_t / price_{t-period}), the additive return basis
- RealizedVolatility — sqrt of summed squared log returns (raw quadratic
variation; the un-annualised counterpart to HistoricalVolatility)
- RollingQuantile — interpolated q-th quantile over a window (type-7)
- RollingIqr — Q3 - Q1 robust dispersion
- RollingPercentileRank — self-normalising rank of the latest value
- SpreadAr1Coefficient — AR(1) rho of the spread a-b (cointegration /
mean-reversion strength; complements OuHalfLife)
Full core + Python/Node/WASM bindings + fuzz + tests. Counter 377 -> 383.
Add four stateless per-bar OHLC transforms so feature extractors can replace hand-built candle-geometry features natively: - CloseVsOpen — signed body as a fraction of open, (close - open) / open - BodySizePct — absolute body as a fraction of the bar range [0, 1] - WickRatio — signed upper-vs-lower shadow imbalance over the range [-1, 1] - HighLowRange — bar range as a fraction of close (scale-free volatility) All param-free Candle -> f64, warmup 1. Full core + Python/Node/WASM bindings (full-OHLC, open-aware) + fuzz + tests. Counter 383 -> 387.
Add three discrete {-1, 0, +1} state classifiers so feature extractors
can replace bespoke labelling logic with native streaming indicators:
- TrendLabel — sign of the rolling OLS slope (scale-invariant trend state)
- JumpIndicator — return outliers beyond threshold x trailing volatility,
measured as deviation from the trailing mean so steady drift is not flagged
- RegimeLabel — volatility-quantile regime split (calm/-1, normal/0,
stressed/+1) by where the rolling volatility sits in its own recent
distribution
Full core + Python/Node/WASM bindings + fuzz + tests. Counter 387 -> 390.
Add two rolling risk/performance statistics over a return stream so feature extractors can replace bespoke trade-stat tracking natively: - WinRate — fraction of strictly-positive returns over the window [0, 1] - Expectancy — expected return per unit of average loss (R-multiple); 0 when the window has no losing returns (no risk reference) Full core + Python/Node/WASM bindings + fuzz + tests. Counter 390 -> 392.
Add four order-book / trade-flow microstructure indicators on the existing OrderBook and Trade inputs (no new input type) so feature extractors can replace bespoke microstructure features natively: - OrderFlowImbalance — rolling sum of best-level order-flow events (Cont-Kukanov-Stoikov OFI) - Vpin — volume-synchronised probability of informed trading (toxicity) - AmihudIlliquidity — average absolute return per unit of traded value - RollMeasure — effective spread from the serial covariance of price changes Queue Imbalance is intentionally not added: it is exactly the existing OrderBookImbalanceTop1 ((bidSize - askSize) / (bidSize + askSize)). Full core + custom Python/Node/WASM bindings + fuzz + dedicated tests. Counter 392 -> 396.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Pin the by-construction-unreachable empty-side branch (reachable only via OrderBook::new_unchecked) for 100% patch coverage.
kingchenc
added a commit
that referenced
this pull request
Jun 4, 2026
Version bump 0.5.3 -> 0.5.4 for the release that ships the 19 external-feature-coverage indicators (#175, 377 -> 396). Bumped: Cargo workspace + wickra-core dep, Cargo.lock (cargo build), pyproject.toml, node package.json (+6 optionalDependencies), 6 npm platform package.json, both package-lock.json, CHANGELOG ([Unreleased] -> [0.5.4]). fmt/test/clippy green locally.
kingchenc
added a commit
to wickra-lib/wickra-docs
that referenced
this pull request
Jun 4, 2026
Deep-dive documentation pages for the 19 indicators shipped in wickra-lib/wickra#175 (external feature-extractor coverage). Families: price-statistics (SpreadAr1Coefficient, RealizedVolatility, LogReturn, RollingQuantile, RollingIqr, RollingPercentileRank), price-action (CloseVsOpen, BodySizePct, WickRatio, HighLowRange), regime/trend/jump labels (RegimeLabel, TrendLabel, JumpIndicator), risk/performance (WinRate, Expectancy), microstructure (AmihudIlliquidity, OrderFlowImbalance, RollMeasure, Vpin). Sidebar, overview index, family table and warmup table updated; deep-dive page count -> 387. VitePress build verified green (no dead links). Merge after the corresponding release publish (docs page count must not precede the registries).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds 19 streaming indicators so an external trading-bot feature extractor can replace its hand-built features with native, batch/streaming-equivalent ones. Each is a real gap (verified against the existing catalogue), production-only, with full Python/Node/WASM bindings, fuzz drivers, and tests. Five commits, one per family group; counter 377 -> 396.
What's added
Price Statistics (6) —
LogReturn,RealizedVolatility(raw quadratic variation, the un-annualised counterpart toHistoricalVolatility),RollingQuantile,RollingIqr,RollingPercentileRank,SpreadAr1Coefficient(pairwise AR(1) rho of the spread; complementsOuHalfLife).Price Action (4) —
CloseVsOpen,BodySizePct,WickRatio,HighLowRange(stateless per-bar OHLC transforms).Regime / Trend / Jump labels (3) —
TrendLabel(sign of the rolling OLS slope),JumpIndicator(return outliers vs trailing volatility, measured as deviation from the trailing mean so steady drift is not flagged),RegimeLabel(volatility-quantile regime split).Risk / Performance (2) —
WinRate,Expectancy(R-multiple).Microstructure (4) —
OrderFlowImbalance(Cont-Kukanov-Stoikov OFI),Vpin,AmihudIlliquidity,RollMeasure. These reuse the existingOrderBook/Tradeinputs (no new input type).Intentionally NOT added (already present, would be duplicates)
skewness.rs/kurtosis.rsare already population moments (divisor n).hurst_exponent.rsalready uses rescaled-range (R/S) analysis.OrderBookImbalanceTop1((bidSize - askSize) / (bidSize + askSize)).Verification
cargo test -p wickra-core(lib 3187 + doc 354),cargo clippy --workspace --all-targets --all-features -D warningsclean, nodenpm run build && npm test(471), pythonpytest(784). Counter consistent acrossmod.rs, lib block, README, and docs/README at 396.