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 BUY label means exit short and enter long, and SELL means the reverse. It builds an ATR trailing line and combines EMA and HMA structure with ADX and DMI, choppiness and efficiency regime checks. New signals pause after volatility shocks or abnormal gaps. State changes are committed only on confirmed bar closes, and higher-timeframe data comes from the previous completed bar. Settings adapt to the chart timeframe.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Auto-adapt settings to chart timeframe
bool
true
useAuto
ATR length
int
14
atrLen
Trend trail distance x ATR
float
3.00
trailFactor
Trail widening in range transition
float
1.30
rangeTrailBoost
Fast EMA length
int
10
fastLen
Slow EMA length
int
34
slowLen
HMA length
int
55
hmaLenInput
Slope lookback
int
3
slopeLookback
ADX/DMI length
int
14
adxLen
Trend ADX threshold
float
19.0
adxTrend
Range ADX threshold
float
16.0
adxRange
Minimum DMI spread
float
2.5
diSpread
Show all 40 settings
Setting
Type
Default
Variable
Choppiness length
int
14
chopLen
Range choppiness threshold
float
61.8
chopEnter
Trend release choppiness threshold
float
55.0
chopRelease
Efficiency length
int
12
effLen
Range efficiency threshold
float
0.24
effRange
Trend efficiency threshold
float
0.32
effTrend
ATR baseline length
int
50
atrBaseLen
Pause new entries above ATR ratio
float
2.40
shockAtrRatio
Pause new entries above candle range x ATR
float
2.80
shockRangeAtr
Pause after abnormal gap
bool
true
useGapFilter
Abnormal gap x previous ATR
float
1.50
gapAtrFactor
Trail-break confirmation closes
int
2
breakConfirmInput
Minimum bars between flips
int
6
minBarsInput
Minimum travel from last flip x ATR
float
0.75
minTravelInput
Trail break buffer x ATR
float
0.10
breakBuffer
Strong reversal distance x ATR
float
1.20
strongBreakFactor
Enable strict early-turn path
bool
true
useEarlyTurn
Early-turn minimum bars
int
6
earlyMinBarsInput
Early-turn confirmation closes
int
2
earlyConfirmInput
Early-turn favorable leg x ATR
float
1.00
earlyLegFactor
Minimum directional quality score
int
4
minScoreInput
Use RSI side as quality evidence
bool
true
useRsiGate
RSI length
int
14
rsiLen
Use candle body as quality evidence
bool
true
useBodyEvidence
Use volume when available
bool
true
useVolumeEvidence
Volume average length
int
20
volumeLen
Volume threshold x average
float
1.05
volumeFactor
Enable higher-timeframe bias
bool
true
useHtf
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