1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
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
Trendline Support Resistance 2024 detects pivot high and low points across a configurable lookback period to draw S/R zones and calculate trendline slopes using ATR, standard deviation, or linear regression methods. Users can enable up to three customized moving averages and display broken level lines. By default, historical elements use backpainting, causing past visual lines to repaint.
Dynamic support and resistance channels from pivot points
Trendlines with configurable slope calculation methods
Up to three customizable moving average overlays
Optional display of pivot points and broken S/R levels
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Swing Detection Lookback
int
14
length
Slope
float
1.
mult
Slope Calculation Method
string
Atr
calcMethod
backpaint
bool
true
backpaint
Up Trendline Color
color
color.teal
upCss
Down Trendline Color
color
color.red
dnCss
Show Extended Lines
bool
true
showExt
Pivot Period
int
10
prd
Source
string
High/Low
ppsrc
Maximum Channel Width %
int
5
ChannelW
Minimum Strength
int
1
minstrength
Maximum Number of S/R
int
6
maxnumsr
Show all 27 settings
Setting
Type
Default
Variable
Loopback Period
int
290
loopback
Resistance Color
color
color.new(color.red, 75)
res_col
Support Color
color
color.new(color.lime, 75)
sup_col
Color When Price in Channel
color
color.new(color.gray, 75)
inch_col
Show Pivot Points
bool
false
showpp
Show Broken Support/Resistance
bool
false
showsrbroken
MA 1
bool
false
showthema1en
showthema1len
int
5
showthema1len
showthema1type
string
SMA
showthema1type
MA 2
bool
false
showthema2en
showthema2len
int
50
showthema2len
showthema2type
string
SMA
showthema2type
MA 3
bool
false
showthema3en
showthema3len
int
200
showthema3len
showthema3type
string
SMA
showthema3type
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.
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
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
This indicator overlays trend-following Supertrend bands on the price chart using Average True Range calculations. It plots trailing stop lines, highlights active trend directions, and prints buy or sell shape labels when price closes across band thresholds. I
This indicator plots two Hull moving averages on the price chart, one of the selected price and one of close, and optionally smooths both with a Kahlman filter. It fills the space between them and marks buy and sell labels when they cross, provided scaled volu
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
Calculates swing points, dynamic support and resistance channels, and a baseline trend moving average directly on the price chart. It identifies structural highs and lows using 10-bar pivot logic, plotting colored triangles offset to confirmed swing bars. Dyna