1Copy the scriptPress Copy script above, or the copy button on the code below.
2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.
Source Code
94 lines of Pine Script v5 from Tradingview/engulfing-patterns.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.
Engulfing Patterns plots two EMAs with a shaded cloud to define trend direction. When price touches or crosses the slower EMA and closes back in trend alignment, the script checks for qualifying bullish or bearish pin bars, hammers, or engulfing candles. Signals and pattern markers are plotted directly on the price chart. Users can configure EMA periods, enable or disable specific patterns, adjust wick-to-body thresholds, and filter bar colors.
Dual EMA trend cloud
Configurable pin bar, hammer, and engulfing pattern detection
EMA pullback and rejection trigger logic
Customizable wick and body percentage thresholds
Optional candle recoloring based on moving average trend
The inputs you can change from the gear icon on the chart. Defaults are the author's.
Setting
Type
Default
Variable
EMA Length 1
int
10
emalength_1
EMA Length 2
int
20
emalength_2
Use Pin Bars
bool
true
use_pin_bars
Pin Bar Wick Size %
float
40.0
pin_bar_wick
Pin Bar Body Size %
float
20.0
pin_bar_body
Use Hammers
bool
true
use_hammers
Hammer Body Area %
float
60.0
hammer_must_close
Use Engulfing
bool
true
use_engulfing
Color Candles Based on MAs
bool
false
color_candles
Bars Between Signals
int
1
wait_between_signals
Liquidity Lookback Candles
int
3
liquidity_candles
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 indicator identifies candlestick patterns on the price chart by combining price action with momentum factors and trend filters. It calculates one of four selectable oscillators: Karobein Oscillator, Money Flow Index, RSI, or Stochastic, alongside trend ru
This indicator overlays on the price chart and provides trend and momentum analysis. It calculates and plots three exponential moving averages with fixed periods of 20, 50, and 200 using yellow, orange, and blue colors respectively. The script also computes th
This overlay indicator marks a bearish hanging man candlestick on the price chart. It looks for a small real body sitting in the upper part of the range, a lower shadow at least twice the body, and no upper shadow, and only while an uptrend filter is active. T
Zen EMA Pullback Patterns identifies pullback formations relative to an Exponential Moving Average on the price chart. It detects 3-bar pullbacks consisting of three consecutive bearish bars above the EMA or bullish bars below it, as well as 4-bar micro channe
This indicator plots Bollinger Bands and smoothed HAMA candles on the price chart. It builds each candle from separate moving averages of open, high, low and close, using selectable EMA, SMA or WMA lengths. A simple moving average forms the band basis, and an
Calculates adaptive arithmetic candles by blending price data with Kaufman Efficiency Ratio smoothing and a linear regression anchor. It measures trend health using a zero-to-hundred Quality Score derived from market efficiency, regression slope, and normalize