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
Trend Scanner Strategy (A/B Test) requires a strong, rising ADX with directional indicators to set the trend direction, and an optional daily SMA 50 and 200 filter. A pullback zone is measured in ATR units from the recent swing. A toggle chooses between entering when the zone is reached or waiting for a pin bar or engulfing candle. It uses ATR-based stop and trailing stop settings, with percent-of-equity sizing and commission.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Use Price Action Entry (Mode B)
bool
true
usePriceAction
ADX / DI Length
int
14
adxLen
ADX Smoothing Length
int
14
adxSmooth
ADX Threshold
int
30
adxTh
ATR Length
int
14
atrLen
ADX Slope Bars
int
3
adxSlopeBars
Swing Lookback (Bars)
int
10
lookback
Min Pullback ATR
float
0.5
minPbAtr
Max Pullback ATR
float
1.5
maxPbAtr
Stop Loss ATR Multiplier (Mode A)
float
1.0
slAtrMult
Trail Stop ATR Multiplier
float
2.0
trailAtrMult
Use Daily SMA Filter
bool
true
useDailyFilter
Show all 15 settings
Setting
Type
Default
Variable
Show SMA Lines on Chart
bool
false
showSmaLines
SMA Fast Length
int
50
smaFastLen
SMA Slow Length
int
200
smaSlowLen
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.
Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish
This strategy combines Ichimoku Kinko Hyo components, a Stochastic oscillator, and specific candlestick patterns to generate trade signals. It identifies Kumo twists and range breakouts while evaluating candle body shapes using Fibonacci threshold filters. Tra
This strategy combines candlestick price action with Exponential Moving Average, RSI, and MACD filters to identify short-term trend trades. A long signal occurs when a bullish candle engulfs the previous open while price remains above the EMA, RSI stays below
An extended version of the JAT+BSM strategy that adds a strategy preset, a risk aggression choice and a pattern type filter to the AlphaTrend style core, MACD, consolidation layers, volume profile and candlestick and macro pattern drawings. Forecasts use kinem
Tweezer Lyfe is a TradingView strategy that identifies Tweezer reversal patterns on the price chart. It plots Bollinger Bands with RSI and stochastic indicators for momentum confirmation. Bullish signals require a prior bearish candle closing near the lower ba
2 EMA/SMA + RSI Strategy [Alorse] combines three configurable moving averages with a short-period Relative Strength Index filter. It plots fast, slow, and trend moving averages on the price chart. Long entries trigger when the fast moving average is above the