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
Entries can occur when price crosses the fast EMA without crossing the slower ones, or when it crosses all of them. Optional volume, stochastic and MACD filters are available, and candle size limits are adjustable. Stops can sit below the candle body or wick or at a percentage, and targets use a risk-reward ratio or percentage. Sizing is percent of equity.
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Show PFR Debug
bool
false
showPFRDebug
Show 123 Debug
bool
false
show123Debug
Show Engulfing Debug
bool
false
showEngulfingDebug
Use EMA Cross Rules
bool
true
useEmaCrossRules
Enable Bear Cross (all emas)
bool
true
enableAllEmaCross
Min Candle 1 Size (absolute units)
float
0.1
minCandle1Size
Min Candle 2 Body Size as % of Candle 1
float
0.1
minCandle2Pct
Max Candle 2 Body Size as % of Candle 1
float
0.5
maxCandle2Pct
Min Candle 3 Body Size as % of Candle 1
float
0.6
minCandle3Pct
Max Candle 3 Body Size as % of Candle 1
float
1.5
maxCandle3Pct
Enable Long Positions
bool
true
enableLong
Enable Short Positions
bool
true
enableShort
Show all 37 settings
Setting
Type
Default
Variable
Use Trend Filter
bool
true
useTrendFilter
Use Volume Filter
bool
false
useVolumeFilter
Minimum Volume Multiplier
float
1.5
minVolume
Use Stochastic Filter
bool
false
useStochFilter
Stochastic Length
int
21
stochLength
Stoch Overbought
float
50
stochOverbought
Stoch Oversold
float
50
stochOversold
Take Profit Type
string
RR-Based
tpType
Take Profit Ratio (vs SL)
float
1.0
profitTargetRR
Take Profit % From Entry
float
1.0
tpPercent
Stop Loss Type
string
Below Candle Wick
slType
Stop Loss %
float
1.0
slPercent
Number of Candles for Lowest Low
int
10
slCandlesLookback
Price Comparison Buffer (%)
float
0.001
priceBufferPct
Enable 123 Pattern
bool
true
enable123
Enable PFR Pattern
bool
true
enablePFR
Enable Engulfing Pattern
bool
true
enableEngulfing
Use MACD Confirmation
bool
false
useMacdConfirmation
MACD Fast Length
int
12
macdFastLength
MACD Slow Length
int
26
macdSlowLength
MACD Signal Length
int
9
macdSignalLength
MA Type
string
EMA
maType
Fast MA Length
int
9
fastLength
Medium MA Length
int
40
mediumLength
Slow MA Length
int
80
slowLength
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 strategy trades price action pin bar patterns aligned with moving average trend alignment on the main price chart. It defines uptrends or downtrends using a fan arrangement of three moving averages (6 EMA, 18 EMA, and 50 SMA). Entry conditions require a b
This overlay strategy marks short-term turning points on the price chart and enters SPY option-style trades from them. It plots simple moving averages of highs and lows, draws up and down reversal arrows, and colors bars when a short-term extreme coincides wit
This strategy calculates and plots smoothed Heikin-Ashi candles directly onto the main price chart using exponential moving averages of open, high, low, and close prices. It enters a long position after three consecutive bullish smoothed candles with sequentia
This strategy executes trades based on candlestick engulfing patterns aligned with a 200-period exponential moving average trend filter. It enters long positions when a bullish engulfing candle follows three consecutive bearish candles while price trades above
This strategy shorts the ES three-minute chart when three consecutive down candles form a triple-red pattern and price is above a Tillson-style T3 average. The average is six nested EMAs of close, combined with fixed coefficients and a user length defaulting t
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