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
+8
View File
@@ -140,6 +140,14 @@ Rust / Python / Node examples. They are grouped by family, mirroring the
- [Indicator-ForceIndex.md](indicators/volume/Indicator-ForceIndex.md)
- [Indicator-EaseOfMovement.md](indicators/volume/Indicator-EaseOfMovement.md)
**Statistics** — price transforms and rolling regressions.
- [Indicator-TypicalPrice.md](indicators/statistics/Indicator-TypicalPrice.md)
- [Indicator-MedianPrice.md](indicators/statistics/Indicator-MedianPrice.md)
- [Indicator-WeightedClose.md](indicators/statistics/Indicator-WeightedClose.md)
- [Indicator-LinearRegression.md](indicators/statistics/Indicator-LinearRegression.md)
- [Indicator-LinRegSlope.md](indicators/statistics/Indicator-LinRegSlope.md)
## See also
- Source code: <https://github.com/kingchenc/wickra>