Indicator · Pine Script v5 · On the chart

Pullback Candle

by theonetrade· code credited to MINTYFRESH97

Pullback Candle is an overlay indicator that highlights bullish pullback patterns directly on the price chart.

View on GitHub

GitHub stars34on the repository
Pine versionv5runs as is
Lines of code31
Settings2inputs
LicenceMIT
Last update2 weeks ago8 Nov 2026

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

31 lines of Pine Script v5 from assets/indicator/bit-exact/pullback_candles_candlestick_analysis_guaranteed_winners_qb0OGnPK.pine, published under MIT. Keep the author's credit and licence lines when you reuse it.

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

//@version=5
//@version=5
indicator("Pullback Candle  " ,overlay=true )

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

//user input
var g_ema    = "EMA Filter"
emaLength    = input.int(title="EMA Length", defval=50, tooltip="Length of the EMA filter", group=g_ema)
useEmaFilter = input.bool(title="Use EMA Filter?", defval=false, tooltip="Turns on/off the EMA filter", group=g_ema)

// Get EMA filter
ema = ta.ema(close, emaLength)
emaFilterLong = not useEmaFilter or close > ema
emaFilterShort = not useEmaFilter or close < ema


//DETECT MARUBUZO

pullBack =  (close[2] < close[3]) and (close[2] < close[3])
     and (close[1] < close[2]) and (close > close[1]) and emaFilterLong and swingLow
     
// Plot our candle patterns
plotshape(pullBack, style=shape.xcross,size=size.tiny, color=color.green, text="PB",location=location.belowbar)
alertcondition(pullBack, "Pullback Candle ", "Pullback Candle  detected for {{ticker}}")
barcolor(pullBack ? color.green :na)

Overview

Pullback Candle checks for consecutive declining closing prices followed by a bullish reversal candle occurring at or near a recent 6-bar swing low. Users can enable an optional Exponential Moving Average (EMA) filter to ensure signals only trigger when price is above the specified trend line. When a pattern is detected, the indicator plots a green cross below the bar, colors the candle green, and triggers an alert condition.

Details

Published by

theonetrade on GitHub

Code credit

MINTYFRESH97, as written in the script's header

Draws

On the price chart

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.

Topics

algorithmic-tradingbacktestingbitcoinccxtcrypto-tradingllm-agentoffline-backtestingopen-source-tradingpine-scriptpine-to-pythonpinescriptpynecorepythonquantquantitative-financestrategy-backtestingtechnical-analysistrading-indicatorstrading-strategiestradingview

Settings

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

SettingTypeDefaultVariable
EMA Lengthint50emaLength
Use EMA Filter?boolfalseuseEmaFilter
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

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 7 months ago · Apache-2.0 GitHub repository of Trend & Momentum Analysis

Hanging Man - Bearish

by TWODS-CAPITAL
37 stars

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

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Hanging Man - Bearish
29 stars

MWM EMA x VWAP Engulfing is an intraday indicator that plots an exponential moving average against session VWAP to evaluate buyer and seller control. It identifies up to five entry setups confirmed by engulfing bodies, rejection wicks, momentum bars, or band t

Indicator v6 Moving averagesCandlestick patterns
Updated 6 weeks ago · MIT GitHub repository of MWM EMA x VWAP Engulfing
29 stars

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

Indicator v6 Moving averagesCandlestick patterns
Updated 5 weeks ago · MIT GitHub repository of Zen EMA Pullback Patterns
17 stars

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

Indicator v5 Candlestick patternsMoving averages
Updated 5 months ago · Apache-2.0 GitHub repository of NSDT HAMA Candles with Bollinger Bands

More Candlestick patterns scripts

Related on ForexR

Trade Your Charts With a Regulated Broker

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

Compare brokers