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 flip passes a chain of tests: confirmed close, clean regime, normalized baseline slope relative to ATR, displacement, a completed structure break and a price-based retracement check. It adds a structure trail lookback and an option to require higher-timeframe agreement for ordinary signals, with a deep-break exception. There are no bar-count holds or cooldowns.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Auto-adapt thresholds by timeframe
bool
true
v5AutoTune
Use completed higher-timeframe context
bool
true
v5UseHtf
Require HTF agreement for ordinary signals
bool
true
v5HtfOrdinaryFilter
Auto-select higher timeframe
bool
true
v5AutoHtf
Manual higher timeframe
timeframe
240
v5ManualHtf
HTF trail factor
float
3.0
v5HtfFactor
HTF ATR length
int
14
v5HtfAtrLen
ATR length
int
14
v5AtrLen
Fast ZLEMA length
int
13
v5FastLen
Slow baseline length
int
55
v5SlowLen
Normalized slope lookback
int
5
v5SlopeLen
Minimum baseline slope x ATR
float
0.12
v5MinSlopeAtr
Show all 40 settings
Setting
Type
Default
Variable
Adaptive KAMA length
int
24
v5KamaLen
KAMA fast length
int
2
v5KamaFast
KAMA slow length
int
45
v5KamaSlow
Adaptive baseline weight
float
0.55
v5KamaWeight
Trail distance x ATR
float
3.35
v5TrailFactor
Trail widening in noisy regime
float
1.50
v5RangeTrailBoost
Structure trail lookback
int
22
v5StructureTrailLen
Structure trail buffer x ATR
float
0.20
v5StructureTrailBuffer
ATR baseline length
int
50
v5AtrBaseLen
Pause ordinary signals above ATR ratio
float
2.80
v5ShockAtrRatio
Pause ordinary signals above candle range x ATR
float
3.20
v5ShockRangeAtr
Pause ordinary signals after abnormal gap
bool
true
v5UseGapFilter
Abnormal gap x previous ATR
float
1.75
v5GapAtrFactor
DMI/ADX length
int
14
v5AdxLen
Minimum trend ADX
float
21.0
v5AdxTrend
Minimum DMI spread
float
4.0
v5DiSpread
Choppiness length
int
21
v5ChopLen
Range state above choppiness
float
61.8
v5ChopEnter
Trend release below choppiness
float
53.5
v5ChopRelease
Efficiency length
int
20
v5EfficiencyLen
Range efficiency threshold
float
0.25
v5EfficiencyRange
Trend efficiency threshold
float
0.38
v5EfficiencyTrend
Minimum ATR ratio for ordinary signals
float
0.95
v5MinAtrRatio
Minimum ATR ratio for reversal energy
float
1.00
v5MinExpansionRatio
Maximum choppiness for ordinary flips
float
54.0
v5MaxFlipChop
Minimum efficiency for ordinary flips
float
0.38
v5MinFlipEfficiency
Volume average length
int
20
v5VolumeLen
Volume threshold x average
float
1.10
v5VolumeFactor
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