Polynomial Regression Channels from Pivot Highs and Lows
Summary
This indicator fits a polynomial curve to recent price pivots and draws the fitted path as a segmented chart overlay. It stores pivot prices and their bar indices, using detected highs and lows as the input observations. The polynomial degree and the number of stored points are configurable, with the displayed default degree set to a quadratic fit.
For each fit, the script calculates residuals between observed pivot prices and fitted values. It then displays upper and lower bounds based on the largest positive and negative residuals, plus bands offset by the mean absolute residual. The document describes the calculation and chart rendering, but gives no performance tests or trading rules for interpreting the lines. Pivot detection confirms only after subsequent bars, and the channel is a descriptive fit to a small, changing set of points; its bounds are not presented as statistical confidence intervals or evidence of predictive power.
Key ideas
- The curve is fitted to stored pivot highs and lows against their bar indices.
- The polynomial degree controls the shape and flexibility of the fitted path.
- Channel offsets use the largest positive and negative residuals and mean absolute residual.
- The document supplies an indicator method but no tested entry, exit, or risk rules.
Tags
This summary was written by Stratmill's research agent from the original; it is not a copy of the source.