F12: add price transforms and rolling linear regression

- Rust core: typical_price.rs ((H+L+C)/3), median_price.rs ((H+L)/2),
  weighted_close.rs ((H+L+2C)/4) — stateless per-bar OHLC transforms — and
  linreg.rs (LinearRegression — endpoint of a rolling ordinary-least-squares
  fit) and linreg_slope.rs (LinRegSlope — slope of that fit). Each with a
  full Indicator impl, runnable doctest and reference / property / warmup /
  reset / batch==streaming tests.
- Python: PyTypicalPrice / PyMedianPrice / PyWeightedClose /
  PyLinearRegression / PyLinRegSlope PyO3 classes + module registration +
  .pyi stubs.
- Node: explicit TypicalPriceNode / MedianPriceNode / WeightedCloseNode /
  LinearRegressionNode / LinRegSlopeNode; index.d.ts and index.js updated.
- WASM: explicit WasmTypicalPrice / WasmMedianPrice / WasmWeightedClose;
  WasmLinearRegression / WasmLinRegSlope via the scalar macro.
- Wiki: a new indicators/statistics/ folder with five Indicator-*.md pages,
  a new "Statistics" family in Indicators-Overview.md and Home.md.

cargo fmt + clippy (core/wickra/data/wasm/node) clean; 454 core tests,
25 data tests and 66 doctests green.
This commit is contained in:
kingchenc
2026-05-22 19:52:04 +02:00
parent 21bbd521b3
commit 2d0ee926c5
19 changed files with 2254 additions and 12 deletions
+10
View File
@@ -30,8 +30,11 @@ mod historical_volatility;
mod hma;
mod kama;
mod keltner;
mod linreg;
mod linreg_slope;
mod macd;
mod mass_index;
mod median_price;
mod mfi;
mod mom;
mod natr;
@@ -53,12 +56,14 @@ mod tema;
mod trima;
mod trix;
mod tsi;
mod typical_price;
mod ulcer_index;
mod ultimate_oscillator;
mod vortex;
mod vpt;
mod vwap;
mod vwma;
mod weighted_close;
mod williams_r;
mod wma;
mod zlema;
@@ -89,8 +94,11 @@ pub use historical_volatility::HistoricalVolatility;
pub use hma::Hma;
pub use kama::Kama;
pub use keltner::{Keltner, KeltnerOutput};
pub use linreg::LinearRegression;
pub use linreg_slope::LinRegSlope;
pub use macd::{MacdIndicator, MacdOutput};
pub use mass_index::MassIndex;
pub use median_price::MedianPrice;
pub use mfi::Mfi;
pub use mom::Mom;
pub use natr::Natr;
@@ -112,12 +120,14 @@ pub use tema::Tema;
pub use trima::Trima;
pub use trix::Trix;
pub use tsi::Tsi;
pub use typical_price::TypicalPrice;
pub use ulcer_index::UlcerIndex;
pub use ultimate_oscillator::UltimateOscillator;
pub use vortex::{Vortex, VortexOutput};
pub use vpt::VolumePriceTrend;
pub use vwap::{RollingVwap, Vwap};
pub use vwma::Vwma;
pub use weighted_close::WeightedClose;
pub use williams_r::WilliamsR;
pub use wma::Wma;
pub use zlema::Zlema;