Indicator · Pine Script v5 · On the chart

Fractal Engulfing Candles

by fiji-solutions· code credited to cmoutafidis

This indicator marks engulfing-style candles on the price chart when they also form at a ten-bar swing.

View on GitHub

GitHub stars1on the repository
Pine versionv5runs as is
Lines of code18
Settings0inputs
LicenceNone statedfile: MPL-2.0
Last update2 years ago3 Oct 2024

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

18 lines of Pine Script v5 from 05. Candlestick Patterns/03. Fractal Engulfing Candles.pine, published under MPL-2.0 (file header). Keep the author's credit and licence lines when you reuse it.

03. Fractal Engulfing Candles.pine
// This Pine Script™ code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © cmoutafidis

//@version=5
indicator(title="Fractal enculfing Caldles", overlay = true)

swingHigh = high == ta.highest(high, 10) or high[1] == ta.highest(high, 10)
swingLow = low == ta.lowest(low, 10) or low[1] == ta.lowest(low, 10)

//ema = ta.ema(close, 50)
rsi = ta.rsi(close, 14)

// previus bar is bearish, the current bar opened lower than prev close, current bar closed higher than prev open, and swing low/high
bullEc = close[1] < open[1] and open <= close[1] and close >= open[1] and swingLow and rsi < 30 // or close > ema
bearEc = close[1] > open[1] and open >= close[1] and close <= open[1] and swingHigh and rsi > 70 // or close < ema

plotshape(bullEc, style = shape.triangleup, location = location.belowbar, color = color.green, size = size.small)
plotshape(bearEc, style = shape.triangledown, location = location.abovebar, color = color.red, size = size.small)

Overview

A bullish mark requires a prior bearish candle, an open at or below that close, a close at or above that open, a swing low, and RSI below 30. A bearish mark uses the opposite candle test, a swing high, and RSI above 70. Green triangles plot below bars and red triangles plot above bars. There are no user inputs, and the script does not issue entries, exits, or stops.

Details

Published by

fiji-solutions on GitHub

Code credit

cmoutafidis, as written in the script's header

Type

Indicator, Pine Script v5

Draws

On the price chart

Category

Candlestick patterns, 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.

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

285 stars

Mean Reversion Study is an indicator that identifies trade setups combining exponential moving averages, RSI extremes, and engulfing candlestick patterns. It highlights bullish setups when a bullish engulfing candle forms below the EMA while RSI is oversold, a

Indicator v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Study

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
55 stars

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

Indicator v6 TrendOscillators & momentum
Updated 6 months ago · Apache-2.0 GitHub repository of Trend & Momentum Analysis

EmaRainbowCandleMark

by fox-buddy
4 stars

EmaRainbowCandleMark is a price-chart overlay that calculates a stack of exponential moving averages with Fibonacci-style lengths and tests candles for hammers, shooting stars, and bullish or bearish engulfing patterns. Body-to-wick tolerances set how strict t

Indicator v4 Moving averagesCandlestick patterns
Updated 2 years ago · None stated GitHub repository of EmaRainbowCandleMark

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]

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