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
A pattern needs the current body to cover a set percentage of the previous body, with options for opposite color, doji handling and a maximum previous body size in ATR. Optional confirmation uses band, momentum and EMA crossover settings, and a trend moving average filter can require price alignment. Stops are ATR or fixed ticks, with targets by risk-reward or ATR. The code describes itself as reconstructed.
Bullish and bearish engulfing pattern detection
Optional band, momentum and EMA crossover confirmation
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
Min Engulfing % of Prev Body
float
100
minEngulfPct
Max Prev Body Size (ATR)
float
2.0
maxPrevBodyATR
Require Opposite Color
bool
true
requireOppositeColor
Allow Engulfing Doji
bool
false
allowDoji
Use VMAlgo Confirmation
bool
true
useVMAlgo
Band Period
int
20
bandPeriod
Fast Period
int
12
fastPeriod
Slow Period
int
26
slowPeriod
StdDev Multiplier
float
2.0
stdDevNumber
Swing Strength (ATR)
int
14
swingStrength
Momentum-Distance Mult
float
1.0
multiplierMD
Distance-to-Band Mult
float
1.0
multiplierDTB
Show all 35 settings
Setting
Type
Default
Variable
Enable EMA Crossover
bool
true
enableEmaCrossover
Fast EMA Period
int
9
fastEmaPeriod
Slow EMA Period
int
21
slowEmaPeriod
Use Trend Filter
bool
true
useTrendFilter
MA Type
string
EMA
trendMAType
Trend MA Period
int
50
trendMAPeriod
Step Size (0=disabled)
int
0
trendMAStepSize
Require Price Action with MA
bool
true
requirePriceAboveMA
Allow Long Entries
bool
true
allowLong
Allow Short Entries
bool
true
allowShort
Entry Offset (Ticks)
int
0
entryOffset
Stop Loss Type
string
ATR
stopType
ATR Period
int
14
atrPeriod
ATR Multiplier (Stop)
float
1.5
atrMultStop
Fixed Stop (Ticks)
int
20
fixedStopTicks
Target Type
string
RR
targetType
Risk:Reward Ratio
float
2.0
riskRewardRatio
ATR Multiplier (Target)
float
3.0
atrMultTarget
Fixed Target (Ticks)
int
40
fixedTargetTicks
Use Trailing Stop
bool
false
useTrailingStop
Trail ATR Multiplier
float
1.0
trailATRMult
Use Session Filter
bool
false
useSessionFilter
Trading Session
session
0930-1600
sessionStart
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
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
ESU2023-10M - V1 is an intraday trend-reversal strategy designed for index futures contracts on the price chart. It calculates a 3-period moving average of candle highs and lows alongside specific three-bar price action patterns to detect short-term swing high
This strategy trades the three-candle strike pattern filtered by trend direction and time sessions. It calculates market regime using linear regression and exponential or smoothed moving averages to distinguish between ranging and trending conditions. Risk man
This strategy tracks consecutive bullish and bearish candlestick closes relative to the preceding bar. It enters a long position when price closes higher for a specified number of consecutive bars, and enters a short position when price closes lower for a desi
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