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
Version 2 makes a reversal a two-stage event: the opposite side must break the active ATR trail for consecutive closes, then show persistence, trade maturity and displacement. It also uses ADX, choppiness, efficiency, gap and shock filters. A multi-timeframe dashboard shows higher-timeframe rows from completed bars, while lower-timeframe rows are disabled.
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 before an opposite flip
int
8
minHoldInput
Minimum opposite displacement x entry ATR
float
0.85
minTravelInput
Minimum mature favorable leg x entry ATR
float
0.60
minFavorableInput
Trail break buffer x ATR
float
0.10
breakBuffer
Strong reversal distance x ATR
float
1.20
strongBreakFactor
Strong reversal confirmation closes
int
2
strongConfirmInput
Directional evidence closes
int
3
oppositeConfirmInput
Emergency reversal depth x ATR
float
2.00
emergencyFactor
Enable early-turn path (strict; more signals)
bool
false
useEarlyTurn
Early-turn minimum bars
int
8
earlyMinBarsInput
Early-turn confirmation closes
int
3
earlyConfirmInput
Early-turn favorable leg x ATR
float
1.20
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
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