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 strategy, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.
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
Longs need an EMA 21, 50 and 200 alignment with rising slopes, then enter on a pullback to the 21 EMA or a breakout above a recent swing high, filtered by ADX, volume against its average, RSI and an optional weekly and Nifty regime check. Stops and targets are ATR multiples, with an optional trailing stop. A conviction score, compact dashboard, labels and risk zones are drawn on the chart. Shorts are supported but less emphasized.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
EMA 21
int
21
e21_len
EMA 50
int
50
e50_len
EMA 200
int
200
e200_len
RSI Length
int
14
rsi_len
ADX Length
int
14
adx_len
Min ADX – Longs
int
18
adx_long
Min ADX – Shorts
int
20
adx_short
Volume MA Length
int
20
vol_len
Volume mult – Longs
float
1.1
vol_long
Volume mult – Shorts
float
1.3
vol_short
Enable Weekly soft filter
bool
true
use_htf
ATR Length
int
14
atr_len
Show all 36 settings
Setting
Type
Default
Variable
SL (ATR×)
float
1.5
sl_mult
TP (ATR×) – Longs
float
3.5
tp_mult_long
TP (ATR×) – Shorts
float
2.25
tp_short
Trailing stop (off = matches backtest)
bool
false
use_trail
Trail activates (ATR×)
float
1.0
trail_atr
Trail offset (ATR×)
float
1.5
trail_offset
Compact dashboard (fits short panes)
bool
true
compact
Entry / exit labels
bool
true
show_marks
Verbose labels (price + score)
bool
false
label_full
Shade risk / reward zones
bool
false
show_zones
Tint background while in a trade
bool
false
show_bg
Enable Pullback entries
bool
true
use_pb
Enable Breakout entries
bool
true
use_bo
Breakout lookback (bars)
int
12
bo_period
Pullback zone tolerance
float
1.008
pb_tol
Enable regime filter
bool
true
use_regime
Nifty50 symbol
symbol
NSE:NIFTY
nifty_sym
Regime EMA period
int
200
regime_ema
Base min bars
int
15
base_period
Max range %
float
5.0
max_range_pct
Base breakout vol ×
float
1.2
base_vol_mult
Swing low lookback
int
50
room_bars
Min room to fall (ATR×)
float
3.0
min_room_atr
Min DI- lead over DI+
float
5.0
di_gap_min
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 trend-following strategy executes a classic Donchian channel breakout system designed to cross-validate backtest results against external framework benchmarks. It triggers a long entry when the closing price breaks above the highest high of the prior entr
This strategy plots running pivot highs as red R circles and pivot lows as blue S circles directly on the price chart. It computes an EMA 3 and a Cto trend line from close prices, then generates long signals on upward EMA-Cto crossovers combined with price pos
The Chained Linear Regression Reversal Strategy plots linear regression channels with upper and lower standard deviation bands directly on the price chart across a user-defined time window. When price breaks out of the static channel for a confirmed number of
This strategy executes trades based on crossovers between a 12-period and a 26-period exponential moving average (EMA). Long positions can be filtered by pivot resistance breakouts and RSI boundary ranges. For trade management, it provides two configurable par
This strategy trades long breakouts of a fast and a slow moving average on the price chart. It opens a long position when price crosses above either average, using a percentage of equity as size. It reduces the position by a set share when the high reaches the
This strategy enters long or short on the price chart when price is on the correct side of a 200-period EMA, MACD agrees, RSI is not at the opposing extreme, ADX exceeds a threshold, volume beats a 20-bar average, and close breaks the recent high or low. A tim