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
A regime layer classifies the market as range or trend using ADX, efficiency and a range box, and can freeze aggressive paths in a range. The ATR trail has a per-bar velocity cap and can tighten after a large trend leg. Flips also need minimum bars, travel, giveback from peak, a swing break and a structure score.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Auto-adapt to chart timeframe
bool
true
useAuto
ADX / DMI length
int
14
adxLen
RANGE if ADX <
float
19.0
adxChop
TREND if ADX ≥
float
24.0
adxTrend
Efficiency lookback
int
12
effLen
RANGE if efficiency <
float
0.24
effRange
Min efficiency for normal flip
float
0.26
effMinFlip
Range box lookback
int
24
rangeLenIn
RANGE if box width < × ATR
float
3.10
rangeMaxAtr
Freeze aggressive paths in RANGE
bool
true
freezeInRange
ATR length
int
14
atrLen
Base trail × ATR
float
3.20
baseMult
Show all 40 settings
Setting
Type
Default
Variable
Extra trail widen in RANGE ×
float
1.40
rangeMultBoost
Pre-smooth source EMA(2)
bool
true
preSmooth
Volume-weighted source when volume exists
bool
false
useVolSrc
VW length
int
12
vwLen
Terminal velocity cap × ATR
float
0.85
vmaxAtr
Trail break buffer × ATR
float
0.10
breakBuf
Tighten trail after large TREND leg
bool
true
useProg
Start tighten after leg × ATR
float
2.50
progStart
Full tighten after leg × ATR
float
5.00
progFull
Min mult fraction
float
0.65
progMinFrac
Min bars between flips (base)
int
10
minBarsIn
Confirm closes beyond trail
int
2
confirmBarsIn
Min travel from last flip × ATR
float
1.35
minTravelIn
Min giveback from peak × ATR
float
1.10
minAdverseIn
Swing lookback
int
10
swingLenIn
Require swing break for trail flip
bool
true
needSwing
Mega breakout depth × ATR
float
2.10
strongBrk
Min structure score (0-5)
int
2
minStruct
Require efficiency gate
bool
true
useEffGate
Enable anti-micro filter
bool
true
useAntiMicro
Min hold bars before reverse
int
18
minHoldBarsIn
Min leg profit × ATR to reverse early
float
1.70
minLegProfitAtr
Micro-window bars
int
20
microWinBars
Micro-window max width × ATR
float
2.40
microWinMaxAtr
Min net path since flip × ATR
float
1.40
minFlipNetAtr
HMA length
int
48
hmaLenIn
ZLEMA fast
int
9
zlFastLen
ZLEMA slow
int
21
zlSlowLen
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 plots an ATR-based Chandelier Exit trailing stop on the price chart. It tracks a long stop under recent highs and a short stop above recent lows, then switches direction when price crosses the opposite stop. Buy and sell labels mark those flips.
The Momentum Setup is a multi-indicator visual tool designed for trend and momentum analysis directly on the price chart. It combines Relative Strength Index (RSI), Money Flow Index (MFI), Commodity Channel Index (CCI), Supertrend, and a 250-bar percentage cha
Range Filter [Alorse] is a technical indicator overlay for TradingView designed to filter market volatility and identify price trends. It calculates a smoothed range based on historical volatility using a configurable sampling period and multiplier applied to
This indicator calculates an ATR trailing stop line derived from the highest high minus an average true range multiple over a specified lookback period. It plots the trailing stop line directly on the price chart and colors price bars based on whether the clos
This indicator plots three exponential moving averages and ATR volatility envelopes on the price chart. It compares the fast and slow EMAs to shade a trend ribbon and marks confirmed upward and downward crossovers with triangle labels. Settings change the thre
This indicator plots Donchian Channel boundary lines along with dynamic fan projections directly on the price chart. It calculates the highest high, lowest low, and median price over a customizable lookback period. Whenever price establishes a new channel high