Skip to content
ChartRiderDocs
Docs/Indicators/Polynomial Regression Bands

Polynomial Regression Bands

Rolling second-degree (or linear) regression of the close with bands at a multiple of the residual standard deviation, plus slope and bend values.

Updated ·Markdown

What you see

Three lines on the price chart: the regression line (Line Color), a translucent green upper band and a translucent red lower band. Each point comes from its own fit over the candles up to that point, so later candles do not redraw earlier values. With Show Window Curves on, ChartRider also draws the complete fitted curve and its bands across the window of the candle under the crosshair, and puts a dot on the most recent candle in that window whose high was above, or whose low was below, the curve's band.

How it is calculated

For every candle, with N = Regression Period and k = Band width:

  1. Fit y = a·x² + b·x + c by least squares to the last N closes at x = 0 to N − 1; with Linear Regression on, fit y = b·x + c.
  2. regression is the fitted curve at the newest candle (x = N − 1).
  3. σ = √(sum of (close − fit)² / N), the spread of the closes around the curve.
  4. upper = regression + k × σ and lower = regression − k × σ.
  5. slope is the change of the curve across the window relative to its newest value: (newest − oldest) / newest.
  6. bend is the curvature from 0 to 1: |a| × (N − 1)² divided by the price range of the curve, compressed with x / (x + 0.15). 0 is a straight line (always with linear regression), values near 1 a strongly arched curve.

With Time Frame Multiplier above 1, the candles are first combined into a higher timeframe (chart timeframe × multiplier, aligned to UTC).

How to read it

  • The regression line is a smoothed trend estimate that bends with price, unlike a straight regression channel.
  • Closes outside the bands are stretched relative to the window's trend: candidates for mean reversion in ranges, or signs of acceleration in breakouts.
  • A rising bend while slope flattens hints that the curve is turning.

Using it in strategies

Outputs: regression, upper, lower, slope and bend. In the Trade Setup, "Compare" a band with the price, e.g. lower above the price for a close below the lower band; "Price vs line" on regression is a trend filter. With a multiplier, a value only counts once its higher-timeframe candle has closed. WickScript has no built-in function for it; use use indicator "PolyReg" with period 150, periodBand 2 as pr and read pr.upper, pr.lower and the other outputs.

Settings

Open the settings with the slider icon next to the indicator (Indicators, F3). Numeric settings can be swept as Step 1 / Step 2 parameters when you run a strategy.

Inputs

SettingTypeDefaultDescription
Regression PeriodNumber150Number of closes per fit (N, at least 3). (min 3)
Linear RegressionOn/offoffFit a straight line instead of a parabola.
Show Window CurvesOn/offoffDraw the full fitted curve with its bands for the candle under the crosshair, plus dots at the latest band breaks inside that window.
Band width (std multiplier)Number2Distance of the bands in standard deviations (k). 0 puts both bands on the regression line. (min 0)
Time Frame Multiplier)Number1Calculate on a higher timeframe: chart timeframe × this whole number. (min 1)

Styles

SettingTypeDefaultDescription
Line ColorColor#1A4C93

Outputs

These values can be used in Trade Setup triggers, filters and exits (see Trade Setup) and in WickScript.

OutputIn WickScriptDescription
regressionregressionEnd point of the fitted curve (a price).
upperupperRegression plus k standard deviations.
lowerlowerRegression minus k standard deviations.
slopeslopeChange of the fitted curve across the window, relative to its newest value.
bendbendCurvature of the fitted curve, from 0 (straight) to 1 (strongly arched).

Use in WickScript

use indicator creates this indicator inside a script, with settings by their ID. Each output is a field of the name after as. See WickScript indicators.

WickScript
wickscript 1
indicator "Polynomial Regression Bands from the list" on chart
use indicator "PolyReg" with period 150 as myPolyreg
show myPolyreg.regression as line "regression"

Generated from the ChartRider source code on every release – settings, outputs and the WickScript reference always match the app.

Imprint·Privacy·Contact·Changelog·llms-full.txt

Paper trading uses play money only. Nothing in these docs is investment advice.