F1: add SMMA and TRIMA moving averages (core)

First step of the indicator-family expansion (see the F section of
todo-detailed.md). Family F1 — Simple & Weighted MAs — gains two
members alongside the existing Sma/Ema/Wma:

- Smma — Wilder's smoothed moving average (RMA): SMA-seeded, then the
  (prev*(n-1)+x)/n recurrence. The average underlying RSI and ATR.
- Trima — triangular moving average: two stacked SMAs (n1/n2 split by
  parity) that triangular-weight the window. Genuine stacking — the
  outer SMA consumes the inner SMA's output.

Both implement the full Indicator trait with reference-value, warmup,
reset, batch==streaming and non-finite-input tests, a runnable doctest,
and are re-exported from the crate root. 208 core tests + 30 doctests
pass; clippy and fmt clean.
This commit is contained in:
kingchenc
2026-05-22 17:10:52 +02:00
parent 3e8c48eefc
commit abd2d80f8d
4 changed files with 362 additions and 2 deletions
+4
View File
@@ -23,8 +23,10 @@ mod psar;
mod roc;
mod rsi;
mod sma;
mod smma;
mod stochastic;
mod tema;
mod trima;
mod trix;
mod vwap;
mod williams_r;
@@ -49,8 +51,10 @@ pub use psar::Psar;
pub use roc::Roc;
pub use rsi::Rsi;
pub use sma::Sma;
pub use smma::Smma;
pub use stochastic::{Stochastic, StochasticOutput};
pub use tema::Tema;
pub use trima::Trima;
pub use trix::Trix;
pub use vwap::{RollingVwap, Vwap};
pub use williams_r::WilliamsR;