Quadratic Regression for Curved Price Trends and Extrapolation
Summary
This indicator fits a second-degree polynomial to a rolling window of price observations by minimizing squared residuals. The resulting curve can represent a parabolic trend that a straight-line regression cannot capture, and its curvature can imply a change in trend direction. A display offset controls how much of the fitted history versus the projected curve appears, while an optional R-squared label reports in-sample fit quality.
The document illustrates the curve against linear regression and explains that R-squared nearer one indicates a closer fit to the observed window. That statistic measures fit to past data; it does not establish that the extrapolated curve will forecast future prices reliably. The implementation displays at most 54 observations and may show errors on symbols with session breaks because it spaces points using elapsed bar time. The author cautions that quadratic models have severe limitations and are rarely useful in stock markets.
Key ideas
- A quadratic polynomial can model curved price paths that a linear regression cannot represent.
- The fitted curve is calculated over a rolling sample by minimizing squared errors.
- R-squared describes in-sample fit and does not validate forecasts.
- The displayed history is limited, and session breaks can distort plotted results.
- The document warns that this approach has significant limitations in stock markets.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.