Indicator · Pine Script v5 · Own pane

Engulf Indicator

by theomgdev

The Engulf Indicator calculates a custom candlestick metric in a separate pane by evaluating the ratio of candle body size to total candle range, comparing it with the previous bar's body size, and normalizing the result with the Average True Range (ATR).

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code20
Settings3inputs
LicenceNone statedfile: MPL-2.0
Last update2 years ago31 Oct 2023

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above, or the copy button on the code below.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new indicator, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart, then adjust the settings with the gear icon next to its name.

Source Code

20 lines of Pine Script v5 from engulf_indicator.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

engulf_indicator.pine
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © theomgdev

//@version=5
indicator("Engulf Indicator")
//atr Length
atrLength = input.int(14, "ATR Length", minval=1)
upperBand = input.int(1, "Upper Band")
lowerBand = input.int(-1, "Lower Band")
atr = ta.atr(atrLength)

getEngulf(atrLen)=>
    needleRatio = math.abs(close-open)/math.abs(high-low)
    sizeRatio = math.abs(close-open)-math.abs(close[1]-open[1])
    atrFiltered = (needleRatio*sizeRatio)/ta.atr(atrLen)
    engulf = atrFiltered-atrFiltered[1]

plot(getEngulf(atrLength), "Engulf", color=color.green, linewidth=2, style=plot.style_area, transp=50)
hline(upperBand, "Engulf Upper Band", color=color.blue)
hline(lowerBand, "Engulf Lower Band", color=color.blue)

Overview

Engulf Indicator plots the rate of change of this metric as an area chart along with upper and lower horizontal threshold lines. Crossings above or below these bands indicate potential engulfing price action and potential trend reversals. Users can adjust the ATR length and threshold band levels.

Details

Published by

theomgdev on GitHub

Type

Indicator, Pine Script v5

Draws

Separate pane below the chart

Category

Candlestick patterns, Volatility & bands, Oscillators & momentum

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
ATR Lengthint14atrLength
Upper Bandint1upperBand
Lower Bandint-1lowerBand
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.

Similar Pine Scripts

Candle Pressure & Response (JMA) evaluates price action dynamics by calculating bidirectional candle pressure, upper and lower wick rejection fractions, body efficiency, and range expansion metrics relative to ATR. Each output series is smoothed using a Jurik

Indicator v6 Candlestick patternsVolatility & bands
Updated yesterday · MIT GitHub repository of Candle Pressure & Response (JMA)

GainzAlgo V2 [Alpha]

by krishnandank
4 stars

This indicator generates buy and sell signals based on engulfing candlestick patterns, a candle stability ratio relative to true range, RSI thresholds, and a multi-bar price momentum condition. It draws visual signal labels on the chart alongside suggested tak

Indicator v5 Candlestick patternsOscillators & momentum
Updated 1 year ago · None stated GitHub repository of GainzAlgo V2 [Alpha]

Raschke Patterns

by TradersPost
218 stars

This overlay indicator marks Linda Raschke short-term bar setups on the price chart. It flags Turtle Soup and Turtle Soup plus one false breakouts of a prior extreme, 80-20 bars, inside bars, failed inside-bar breakouts, outside up and down bars, NR4 and NR7 c

Indicator v6 Candlestick patternsBreakout Repaints
Updated 3 months ago · None stated GitHub repository of Raschke Patterns

GainzAlgo V2 [Alpha]

by IAMATOMIC001
3 stars

This indicator detects buy and sell signals on the price chart by combining engulfing candlestick patterns, body-to-range stability ratios, RSI boundaries, and price momentum over ten bars. Confirmed signals trigger visual buy and sell labels directly on candl

Indicator v5 Candlestick patternsOscillators & momentum
Updated 12 months ago · None stated GitHub repository of GainzAlgo V2 [Alpha]

This indicator plots buy and sell labels on the price chart. A buy appears when a short stochastic crosses up from below 20 while a slow MACD histogram is positive and a faster MACD histogram is negative. A sell uses the opposite stochastic and MACD alignment.

Indicator v5 Oscillators & momentumCandlestick patterns
Updated 5 months ago · None stated GitHub repository of Heikin Ashi with MACD Signals

RSI Chart Signals

by Web3Degenerate
2 stars

This indicator plots a customized RSI line on the price chart along with buy and sell signals triggered by bullish and bearish engulfing candle patterns. It calculates RSI using a user-adjustable length and custom overbought and oversold thresholds. Signals oc

Indicator v5 Oscillators & momentumCandlestick patterns
Updated 2 years ago · None stated GitHub repository of RSI Chart Signals

More indicators

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers