Indicator · Pine Script v5 · On the chart

REG-TREND

by gocaman

The REG-TREND indicator plots linear regression trend lines calculated from the selected source over a user-defined length.

View on GitHub

GitHub stars3on the repository
Pine versionv5runs as is
Lines of code529
Settings40inputs
LicenceNone stated
Last updatetoday28 Oct 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

REG-TREND determines channel boundaries and deviation to detect trend breaks, marking them with dotted lines in the chosen color. Fibonacci retracement levels can be overlaid on the regression lines. The indicator draws directly on the price chart to visualize trend direction and potential channel breaks. Settings control line length, deviation multiplier, extension, visibility of broken channels and Fibonacci levels, as well as colors and width. It provides trend identification but includes no entry, exit, stop loss, or position sizing rules.

Details

Published by

gocaman on GitHub

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Trend, Support & resistance, Moving averages

Markets

Stocks

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
Grup seçstring1grupSec
PERİYOTtimeframeper
Konum Ayarıint20loc
Sourcesourceclosesrc
Lengthint100len
Deviationfloat2.devlen
Extend Linesbooltrueextendit
Show Fibonacci Levelsboolfalseshowfibo
Show Broken Channelbooltrueshowbroken
brokencolcolorcolor.bluebrokencol
Up/Down Trend Colorscolor#00ab25upcol
dncolcolor#df0202dncol
Show all 40 settings
SettingTypeDefaultVariable
Line Widthint2widt
Sourcesourceclosesrc5
5EMAint5len5
8EMAint8len8
13EMAint13len13
History bars backint300history_bars
Resolution (bars)int6xx1
1symbolsb1
2symbolBIST:XAKURsb2
3symbolBIST:XBANAsb3
4symbolBIST:XBANKsb4
5symbolBIST:XBLSMsb5
6symbolBIST:XELKTsb6
7symbolBIST:XFINKsb7
8symbolBIST:XGIDAsb8
9symbolBIST:XGMYOsb9
10symbolBIST:XHOLDsb10
11symbolBIST:XILTMsb11
12symbolBIST:XINSAsb12
13symbolBIST:XKAGTsb13
14symbolBIST:XKMYAsb14
15symbolBIST:XMADNsb15
16symbolBIST:XMANAsb16
17symbolBIST:XMESYsb17
18symbolBIST:XSGRTsb18
19symbolBIST:XSPORsb19
20symbolBIST:XTASTsb20
21symbolBIST:XTCRTsb21
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

257 stars

This indicator analyzes short-term price action on index futures and options charts by applying Rational Quadratic kernel smoothing to detect sideways consolidation ranges and potential breakouts. It processes pivot highs and lows over customizable loopback pe

Indicator v5 Support & resistanceTrend Repaints
Updated 6 weeks ago · None stated GitHub repository of SPX 30M - Trading Chart

Ichimoku Cloud

by harryguiacorn
219 stars

This indicator plots Ichimoku Cloud elements on the price chart, including Tenkan-sen, Kijun-sen, Senkou Span A and B lines with optional Chikou Span. It signals trend changes via Tenkan-sen and Kijun-sen crosses and places arrows at Kijun-sen direction shifts

Indicator v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Ichimoku Cloud

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)
56 stars

This indicator calculates an Exponential Moving Average and a Zero-Lag Moving Average to identify market trends on the price chart. It plots both moving averages and fills the space between them with color to highlight trend direction. Upon a crossover or cros

Indicator v5 TrendMoving averages
Updated 2 months ago · None stated GitHub repository of No-Lag MA Trend Levels

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