Document ATR seed conventions and add explicit seed/warmup options (Wilder 1978 vs TA-Lib)
Problem / Context
As observed by trade_backtest during dogfooding:
qw.atr(h, l, c, period=14, smoothing='wilder') returns NaN for bars 0–13 and seeds at bar 14 as mean(TR[1..14]), matching TA-Lib.
In contrast, J. Welles Wilder Jr.'s original 1978 specification (New Concepts in Technical Trading Systems) defines TR[0] = H[0] - L[0] and seeds the first ATR at bar 13 as mean(TR[0..13]), then recurses as ATR[t] = (13 * ATR[t-1] + TR[t]) / 14.
The seed difference decays exponentially and falls below 1e-9 by bar 400, but creates a 1-bar phase difference and slight initial divergence on short lookbacks.
Asks
- Document the ATR seed convention across plain Python, Polars
.ta, and Rust docstrings /CONVENTION_NOTES. - Add an explicit
seed=/warmup=parameter:seed="talib"(default, standard TA-Lib behavior): bar 0 TR undefined, seeds at barperiodfromTR[1..period].seed="wilder1978"(aliases:"classic","wilder"): Wilder 1978 book formula withTR[0] = H[0] - L[0], seeds at barperiod - 1fromTR[0..period-1].- Support in plain Python (
qw.atr), streaming (qw.Atr), and Polars (pl.col().ta.atr).
Resolved: Added explicit seed='talib' (default) and seed='wilder1978' (or 'classic') options across plain Python qw.atr, streaming qw.Atr, and Polars pl.col().ta.atr. Documented the seed convention in docstrings and CONVENTION_NOTES.