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
ZigZag 1 uses depth 12, deviation 5 and backstep 3 for the main trend. ZigZag 2 uses depth 5, deviation 3 and backstep 2 for the fast trend. Five EMAs with lengths 20, 30, 40, 75 and 200 are available with custom colors. Trend strength is calculated in five levels using the spacing between EMAs relative to ATR multiplier. A bottom bar shows the current trend level and a fill appears between EMA 20 and 40.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Show ZigZag 1
bool
true
d1_show
Depth
int
12
d1_depth
Deviation (Points)
int
5
d1_deviation
Backstep
int
3
d1_backstep
Line Color
color
color.white
d1_color
Line Thickness
int
2
d1_width
Show ZigZag 2
bool
true
d2_show
Depth
int
5
d2_depth
Deviation (Points)
int
3
d2_deviation
Backstep
int
2
d2_backstep
Line Color
color
color.fuchsia
d2_color
Line Thickness
int
2
d2_width
Show all 28 settings
Setting
Type
Default
Variable
Show EMAs
bool
true
show_ema
EMA 1 Length
int
20
ema1_len
EMA 1 Color
color
color.red
ema1_col
EMA 2 Length
int
30
ema2_len
EMA 2 Color
color
color.blue
ema2_col
EMA 3 Length
int
40
ema3_len
EMA 3 Color
color
color.yellow
ema3_col
EMA 4 Length
int
75
ema4_len
EMA 4 Color
color
color.green
ema4_col
EMA 5 Length
int
200
ema5_len
EMA 5 Color
color
color.purple
ema5_col
Show Bottom Bar
bool
true
show_trend_bar
Fill EMA 20-40
bool
true
show_fill
Level 5 Threshold (ATR Multiplier)
float
2.0
trend_max_mult
Up Trend Base Color
color
color.lime
base_col_up
Down Trend Base Color
color
color.red
base_col_dn
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
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