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
By default it allows longs only when EMA 50 is above EMA 200 and an RSI-SMA momentum filter is met, with an ATR entry buffer. Exits use an initial ATR stop, breakeven and trailing stops, plus optional RSI-and-price confirmation and opposite trendline breaks. Swing lookback, slope method, and long or short permission are the main settings. It is built for XAUUSD on the 30-minute chart and can pyramid up to four entries.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Swing Detection Lookback
int
6
length
Slope Multiplier
float
1.0
mult
Slope Calculation
string
Atr
calcMethod
EMA Trend Filter (50 > 200)
bool
true
useTrend
Allow Long Trades
bool
true
allowLongs
Allow Short Trades
bool
false
allowShorts
RSI-SMA Momentum Filter
bool
true
useRSISMA
RSI-SMA Baseline (Longs)
int
48
rsiSMABaseline
Entry Buffer (ATR ×)
float
0.10
bufATRx
RSI + Price Confirmation Exits
bool
true
useRSI
RSI Length
int
14
rsiLen
Long Exit: RSI <
int
40
rsiExitLong
Show all 25 settings
Setting
Type
Default
Variable
RSI Confirmation Bars
int
3
rsiConfirmBars
Price Confirmation EMA
int
20
emaConfirm
Min Profit for RSI Exit (ATR ×)
float
0.5
minProfitRSI
Opposite Break Exits
bool
true
useOppBreak
Min Profit for Opp Break (ATR ×)
float
0.8
oppBreakMinProfit
ATR Period (Daily)
int
5
atrDailyLen
Initial Stop Loss (ATR ×)
float
1.5
slATR
Trailing Stop (ATR ×)
float
2.0
trailATR
Breakeven Trigger (ATR ×)
float
0.7
beTriggerATR
Breakeven Offset (ATR ×)
float
0.3
beOffsetATR
Upper Trendline Color
color
color.teal
upCss
Lower Trendline Color
color
color.red
dnCss
Show Extended Lines
bool
true
showExt
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
Calculates multi-period logarithmic regression trend channels and deviation bands across up to twenty selectable lookback lengths directly on the price chart. It evaluates channel slopes and Pearson's correlation coefficient to detect market trends and generat
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
This strategy trades 1-minute futures contracts on Binance. It plots pivot high and low resistance and support levels on the price chart, along with an EMA and a custom Cto indicator. Long and short entries trigger on EMA and Cto crossovers combined with price