Summary
ChandeForecastOscillator is RTTA's streaming implementation of Tushar Chande's
forecast oscillator: the percent distance of the current close from a one-step
linear-regression time-series forecast (TSF).
Update API
value = rtta.ChandeForecastOscillator(window=14, fillna=True).update(close)
The update(...) call consumes one close. advance(...) uses the same input
without returning a Python value. Scalar batch(...) returns a NumPy array.
Theory Of Operation
A rolling least-squares line over the last \(n\) closes produces a one-bar-ahead
forecast (the same quantity exposed by TimeSeriesForecast). The forecast
oscillator asks how far the live close sits above or below that forecast, as a
percent of price. Positive values mean price is above the fitted extrapolation;
negative values mean it is below.
Recurrence
Let \(x_t\) be close and \(n\) be window. Over the rolling window of the last
\(n\) samples with abscissae \(0,\ldots,n-1\), fit
and form the one-step forecast
(as in RTTA's LinearRegressionCore, where tsf is the intercept plus slope
times \(n\)). The oscillator is
Implementation Notes
The recurrence is implemented in src/rtta/indicator.cpp in
class ChandeForecastOscillator using LinearRegressionCore and its tsf
field.
