Indicator · Pine Script v5 · On the chart

Moving Regression Prediction Bands

by regalouisei· code credited to tbiktag

The Moving Regression Prediction Bands indicator calculates polynomial regression bands from historical price data using a moving window.

View on GitHub

GitHub stars2on the repository
Pine versionv5runs as is
Lines of code255
Settings6inputs
LicenceNone stated
Last update8 months ago25 Feb 2026

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Moving Regression Prediction Bands fits a polynomial curve of specified degree to generate upper and lower bands representing expected price ranges with prescribed probability. The central line displays the regression trend or previous-period prediction and can appear as a ribbon. Breakout signals trigger when price crosses the bands. Adjustable inputs control the source series, polynomial order, window length, band multiplier, and signal visibility. The indicator overlays directly on the price chart to visualize price action against the regression bands.

Details

Published by

regalouisei on GitHub

Code credit

tbiktag, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Moving averages, Volatility & bands, Support & resistance

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
Sourcesourceclosesrc
Polynomial Orderint2degree
Length (must be greater than Order)int100window
Multiplierfloat2.0mult
Show Breakout Signalsbooltrueissignal
Show Central Line AsstringRibbonclinetype
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

Snag - VWAP

by dearvn
257 stars

This indicator plots a custom Anchored Volume-Weighted Average Price (VWAP) directly on the price chart along with optional standard deviation bands. Users can anchor the VWAP to standard time periods like sessions, weeks, or months, or to corporate events suc

Indicator v5 Moving averagesVolatility & bands Repaints
Updated 6 weeks ago · None stated GitHub repository of Snag - VWAP

MA Envelope (MAE)

by mihakralj
99 stars

The MA Envelope indicator calculates upper and lower channel bands shifted by a user-defined percentage around a baseline moving average. It supports Simple Moving Average, Exponential Moving Average, and Weighted Moving Average calculation types. The script p

Indicator v6 Moving averagesSupport & resistance
Updated 4 weeks ago · Apache-2.0 GitHub repository of MA Envelope (MAE)

Moon Dev GEX Walls & Trap

by moondevonyt
92 stars

This indicator estimates gamma exposure levels and intraday context for index instruments like SPY and ES. It calculates VWAP with standard deviation bands as a gamma flip proxy, highlighting market regimes through background colors. It plots prior day high, l

Indicator v5 Support & resistanceSessions & time
Updated 8 weeks ago · Custom licence GitHub repository of Moon Dev GEX Walls & Trap

Median

by TWODS-CAPITAL
37 stars

The Median indicator calculates the median of a selected source series such as the high-low average over a user-defined length and plots it as a red line on the price chart. It draws an EMA of the median as a blue line and fills the space between them, changin

Indicator v5 Moving averagesVolatility & bands
Updated 3 years ago · MIT GitHub repository of Median
20 stars

This indicator calculates a base moving average (EMA, SMA, WMA, or HMA) and projects multiple symmetrical envelope bands around it directly on the price chart. Users can adjust the length, source, moving average type, and initial envelope multiplier. Additiona

Indicator v5 Moving averagesVolatility & bands
Updated 1 year ago · None stated GitHub repository of Multiple Moving Average Envelope

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers