# Polynomial Regression Extrapolation

Polynomial Regression Extrapolation is an indicator on [Vela](https://vela.luxalgo.com/chart), our next-generation charting platform, written in Pine Script®.

Polynomial Regression Extrapolation fits a polynomial of a chosen degree (up to 8) to recent price and projects the fitted curve forward. Degree 1 recovers the straight-line trend, higher degrees bend around accelerating moves, and a Lock Forecast option freezes the model so the forecast stays put. A clean statistical lens for trend and turning-point analysis.

- Indicator in the LuxAlgo Library, by LuxAlgo, published Jun 30, 2022.
- Access: free.
- Concepts: [Polynomial Regression](https://www.luxalgo.com/library/concept/polynomial-regression/) (primary)
- Open on Vela: https://vela.luxalgo.com/chart?pineScriptCodeId=cmpwn4md2006gvhsgtpapg7j4
- Page: https://www.luxalgo.com/library/indicator/polynomial-regression-extrapolation/

**Polynomial Regression Extrapolation** fits a [polynomial curve](https://www.luxalgo.com/library/concept/polynomial-regression/) of user-defined degree to recent prices and extends the result into the future, turning a statistical fit into a visible forecast on the chart. Degree 1 recovers the familiar straight regression line; higher degrees let the curve bend with accelerating trends and hint at where they might turn.

## How to Trade the Polynomial Regression Extrapolation?

- **Degree 1**: a straight line, the cleanest read on linear trend direction.
- **Degree 2**: a parabolic fit suited to steadily accelerating moves.
- **Higher degrees (such as 6)**: capture intricate variation and can flag potential turning points. Validate these with caution before acting.
- **Extrapolated segment**: the forward portion of the curve is the model's projection; watch how price behaves against it rather than trading it blindly.

As a rule, lower degrees describe the broad trend while higher degrees map detail at the cost of noise. Going beyond degree 3 usually adds more of the latter than the former. The fitted curve can also serve as a reference for support or resistance within the trend it describes.

## Polynomial Regression Extrapolation Settings

- **Length**: how many recent price observations feed the fit.
- **Extrapolate**: the forecast horizon, how far forward the curve is projected.
- **Polynomial Degree** (default 3, from 0 to 8): the polynomial degree, the central trade-off between smoothness and detail.
- **Src**: the price source being modeled.
- **Lock Forecast**: freezes the fit so the curve extends to the most recent bar without re-fitting to new prices.

## Frequently Asked Questions

### Can it predict exact turning points?

No forecast can. Higher-degree fits may highlight areas where a trend could bend, but those projections should be confirmed with other analysis before acting. The extrapolation describes tendency, not certainty.

### How does it relate to Linear Regression?

[Linear Regression](https://www.luxalgo.com/library/indicator/linear-regression/) fits a straight line, equivalent to running this tool at degree 1. Raising the degree lets the fit bend with the trend, capturing acceleration a straight line misses, at the price of extra noise in the extrapolation.

### How can I start using Polynomial Regression Extrapolation?

It's a free LuxAlgo Library tool. Apply it straight from this page, and if you want to experiment with degrees systematically, you can run it in Quant, our coding agent, as well. You can also copy the source code from this page and run it anywhere Pine Script® runs.

## Related indicators

- [Daily Polynomial Regressions](https://www.luxalgo.com/library/indicator/daily-polynomial-regressions/) (Polynomial Regression): markdown at https://www.luxalgo.com/library/indicator/daily-polynomial-regressions.md
- [Spline Quantile Regression Channel](https://www.luxalgo.com/library/indicator/spline-quantile-regression-channel/) (Polynomial Regression): markdown at https://www.luxalgo.com/library/indicator/spline-quantile-regression-channel.md
- [Cubic Bézier Curve Extrapolation](https://www.luxalgo.com/library/indicator/cubic-b-zier-curve-extrapolation/) (Polynomial Regression): markdown at https://www.luxalgo.com/library/indicator/cubic-b-zier-curve-extrapolation.md
- [Bitcoin Power Law](https://www.luxalgo.com/library/indicator/bitcoin-power-law/) (Linear Regression): markdown at https://www.luxalgo.com/library/indicator/bitcoin-power-law.md
- [Recursive Least Squares Forecast](https://www.luxalgo.com/library/indicator/recursive-least-squares-forecast/) (Linear Regression): markdown at https://www.luxalgo.com/library/indicator/recursive-least-squares-forecast.md
- [Adaptive Harmonic Forecast](https://www.luxalgo.com/library/indicator/adaptive-harmonic-forecast/) (FFT/spectral Analysis): markdown at https://www.luxalgo.com/library/indicator/adaptive-harmonic-forecast.md
- [Kalman Filter](https://www.luxalgo.com/library/indicator/kalman-filter/) (Statistics): markdown at https://www.luxalgo.com/library/indicator/kalman-filter.md
- [Bitcoin Expectile Model](https://www.luxalgo.com/library/indicator/bitcoin-expectile-model/) (Quantile Regression): markdown at https://www.luxalgo.com/library/indicator/bitcoin-expectile-model.md

---

Source: https://www.luxalgo.com/library/indicator/polynomial-regression-extrapolation/ (LuxAlgo Library). Free to use with attribution: https://www.luxalgo.com/library/license/
