Pine Library · 656 open-source scripts

Free Candlestick Pattern Pine Scripts (page 10)

Open-source Pine scripts that find candlestick patterns: engulfing bars, pin bars, doji, inside bars, Heikin Ashi and multi-candle patterns.

Pine scripts656
Code shown here386open licence
Updated in a year368
No repaint flag575

Candlestick patterns: Indicators, Strategies and Libraries

3.Candlestick - 5.Doji Candles

by Web3Degenerate
2 stars

This indicator identifies indecision doji candles and highlights potential market reversals directly on the price chart. It calculates the candle body percentage relative to total range and compares the upper and lower wick proportions. When a valid doji coinc

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of 3.Candlestick - 5.Doji Candles

Grimm HA

by GreyssonEnterprises
1 stars

A Pine v4 indicator that measures candle body size, shadow lengths and doji conditions on the price chart, then looks for a Heikin-Ashi style reversal bar following a doji. Matching bars are recoloured, and triangle markers with text labels and alert condition

Indicator v4 Candlestick patterns
Updated 2 months ago · MIT GitHub repository of Grimm HA

Symmetric Attraction

by morindok
1 stars

Symmetric Attraction is an indicator that plots mirrored candles on the price chart by reflecting OHLC data around a regression basis line. The basis is computed using linear regression on the selected source with an optional logarithmic transformation. It als

Indicator v6 Candlestick patternsSupport & resistance
Updated 7 weeks ago · None stated GitHub repository of Symmetric Attraction

Basic Engulfing Candles

by Web3Degenerate
2 stars

This indicator identifies standard bullish and bearish engulfing candlestick patterns and plots visual signals directly on the price chart. A bullish engulfing pattern occurs when a bearish bar is followed by a bar that opens below or equal to the prior close

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Basic Engulfing Candles

P_err_strategy_risk

by GammaExpansion
1 stars

This minimal strategy demonstrates Pine Script risk management functions by enforcing a maximum drawdown limit of ten percent of equity. The script enters a long position whenever a candle closes higher than its opening price. It plots the current position siz

Strategy v6 Candlestick patterns
Updated 6 days ago · MIT GitHub repository of P_err_strategy_risk

GrimmArty

by GreyssonEnterprises
1 stars

A Pine v4 indicator that draws four smoothed moving averages (21, 50, 100 and 200) with a trend fill, marks bullish and bearish three line strike patterns with triangles, and adds large engulfing-style candle markers. It can also shade a time-zone trading sess

Indicator v4 Moving averagesCandlestick patterns
Updated 2 months ago · MIT GitHub repository of GrimmArty
257 stars

This overlay indicator rebuilds a synthetic candle from the current open and the previous three opens. It treats the highest and lowest of those earlier opens as the range, the prior open as the synthetic open, and the current open as the synthetic close. From

Indicator v5 TrendCandlestick patterns
Updated 6 weeks ago · None stated GitHub repository of Snag - Best Futures Color Trend

Consecutive Up/Down Strategy

by TWODS-CAPITAL
37 stars

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

Strategy v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Consecutive Up/Down Strategy

MTF Heiken Ashi

by jerryinyang
5 stars

This indicator evaluates Heikin Ashi trend direction across three user-defined higher timeframes. It determines directional bias using either manual Heikin Ashi calculations or imported Heikin Ashi ticker data, with an optional wick filter to assess wick perce

Indicator v4 TrendCandlestick patterns
Updated 2 years ago · None stated GitHub repository of MTF Heiken Ashi

Grimmarty Backtest

by GreyssonEnterprises
1 stars

A Pine v4 indicator that draws four smoothed moving averages (21, 50, 100 and 200), a trend fill between a short EMA and the 200 average, and three line strike candle markers for bullish and bearish cases. It also shades a time-zone trading session and holds i

Indicator v4 Moving averagesCandlestick patterns
Updated 2 months ago · MIT GitHub repository of Grimmarty Backtest
3 stars

CSW Sequence Candles Pro calculates 5-period EMA-smoothed Open, High, Low, and Close values to render custom sequence candlesticks directly on the main price chart. It determines trend direction by comparing the smoothed close to a 20-period EMA, dynamically c

Indicator v5 Candlestick patternsTrend
Updated 5 months ago · None stated GitHub repository of CSW Sequence Candles Pro

Candle Filters

by Web3Degenerate
2 stars

Candle Filters is an overlay indicator that marks bullish and bearish engulfing candles on the price chart. A bullish signal requires a prior down candle whose body is engulfed by the current candle near a swing low, while a bearish signal does the reverse nea

Indicator v5 Candlestick patternsMoving averages
Updated 2 years ago · None stated GitHub repository of Candle Filters

GrimmHAbacktest

by GreyssonEnterprises
1 stars

This indicator plots four smoothed moving averages of lengths 21, 50, 100 and 200 on the price chart. It fills the area between a two-period EMA and the 200-period SMMA to highlight trend direction. It marks bullish and bearish 3-line strike patterns with arro

Indicator v4 Moving averagesCandlestick patterns
Updated 2 months ago · MIT GitHub repository of GrimmHAbacktest

Major Buy Setup

by dcaoyuan
55 stars

Major Buy Setup plots a 20-period and a 50-period simple moving average on the price chart. It marks a buy when the current bar is both a bullish engulfing candle and a bald bull candle, defined as a green candle whose upper shadow is no more than five percent

Indicator v5 Moving averagesCandlestick patterns Repaints
Updated 6 months ago · Apache-2.0 GitHub repository of Major Buy Setup

Assistant

by eddiebelaval
7 stars

Assistant is an overlay indicator that marks candles with small or missing upper and lower wicks, using a threshold relative to body size. It plots three-candle and five-candle swing fractals as triangles two bars back, and fires alerts when a bullish or beari

Indicator v6 Candlestick patternsSupport & resistance
Updated 3 months ago · None stated GitHub repository of Assistant
2 stars

This educational indicator calculates and visualizes market gap sizes in a separate pane. It computes two distinct metrics: the absolute percentage gap between the current bar open and the previous close, and the percentage gap distance between the current bar

Indicator v5 Candlestick patternsVolatility & bands
Updated 2 years ago · None stated GitHub repository of Candlesticks - Calculating Gaps

Dark Cloud Cover - Bearish

by TWODS-CAPITAL
37 stars

Identifies the two-candle Dark Cloud Cover bearish reversal candlestick pattern on price charts. The indicator evaluates the prevailing trend using optional simple moving averages (SMA 50 or SMA 200) and checks for a strong bullish candle followed by a bearish

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Dark Cloud Cover - Bearish

GrimmTurtleTest

by GreyssonEnterprises
1 stars

A Pine v4 indicator that combines several tools on the price chart: smoothed moving averages of 21, 50, 100 and 200 bars, a trend fill between a fast EMA and the 200 line, a three-line strike candle pattern and engulfing candle markers. A configurable trading

Indicator v4 Moving averagesCandlestick patterns
Updated 2 months ago · MIT GitHub repository of GrimmTurtleTest
947 stars

The Heikin-Ashi Chart Identifier is an indicator that checks if the current chart uses Heikin-Ashi candles. It tracks matched candles where open equals the average of previous open and close, and verifies no gaps between bars. When conditions match, it display

Indicator v4 Candlestick patterns
Updated 11 days ago · GPL-3.0 GitHub repository of Heikin-Ashi Chart Identifier

Draw - Bar and Candles

by Web3Degenerate
2 stars

This educational Pine Script indicator demonstrates how to plot custom price bars using the built-in plotbar function. The script determines whether the current bar is bullish or bearish by comparing the close price to the open price, applying a green or red c

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Draw - Bar and Candles
46 stars

This indicator identifies inside bars and outside bars, classifying each by close direction as bullish or bearish. It tracks cumulative occurrences and evaluates how often subsequent price action breaks the high or low of each pattern. A summary table drawn on

Indicator v5 Candlestick patternsScreeners & dashboards
Updated 7 weeks ago · None stated GitHub repository of Inside bar/outside bar - stats
947 stars

This indicator checks whether the current chart uses Kagi chart formatting. It analyzes price bar structural characteristics by counting bars where open or close equals the high, low, and adjacent open/close levels across the history. An informational label di

Indicator v4 Candlestick patterns
Updated 11 days ago · GPL-3.0 GitHub repository of Kagi Chart Identifier

Doji

by TWODS-CAPITAL
37 stars

This indicator marks standard doji candles on the price chart. It treats a bar as a doji when the range is positive, the body is no larger than five percent of the range, and the upper and lower shadows are nearly equal. Dragonfly and gravestone variants are e

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Doji

Custom Engulfing

by g-moe
3 stars

Custom Engulfing is an overlay indicator that highlights bullish and bearish candle patterns directly on the price chart using background colors. It identifies a bullish signal when a green candle closes above the prior candle's body and its body length exceed

Indicator v5 Candlestick patterns
Updated 5 months ago · None stated GitHub repository of Custom Engulfing

ICT Setup 01 TFlab

by alvinng214
2 stars

This indicator detects Fair Value Gaps using a multiplier factor and validity period. It identifies liquidity sweeps and hunts within or outside defined zones to generate long and short signals. Signals can be configured to fire after a specified number of hun

Indicator v5 SMC / ICT / price actionSupport & resistance
Updated 2 months ago · None stated GitHub repository of ICT Setup 01 TFlab

This indicator scans the chart for 101 distinct patterns, including single-bar, two-bar, and multi-bar candlestick patterns, classic chart patterns, and harmonic patterns. It features a complex situation context engine for confluence detection and displays a B

Indicator v5 Candlestick patternsSupport & resistance Repaints

Doji Star - Bearish

by TWODS-CAPITAL
37 stars

This indicator detects and highlights the Bearish Doji Star candlestick reversal pattern directly on the price chart. It checks for an uptrend using simple moving average rules, followed by a long bullish candle and a gapping doji candle. When identified, the

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Doji Star - Bearish

0-1 Reversal Signals

by morindok
1 stars

0-1 Reversal Signals tracks consecutive sequences of bullish or bearish candlestick closes to highlight potential trend reversals. It counts consecutive green (1) or red (0) candles and generates visual Buy or Sell shape signals directly on the price chart whe

Indicator v5 Candlestick patternsTrend
Updated 7 weeks ago · None stated GitHub repository of 0-1 Reversal Signals

Polish

by GreyssonEnterprises
1 stars

This indicator overlays multiple smoothed moving averages, candlestick reversal patterns, and trading session highlights directly onto the price chart. It calculates 21, 50, optional 100, and 200-period smoothed moving averages alongside a short-term moving av

Indicator v4 Moving averagesCandlestick patterns
Updated 2 months ago · MIT GitHub repository of Polish
257 stars

This overlay strategy marks short-term turning points on the price chart and enters SPY option-style trades from them. It plots simple moving averages of highs and lows, draws up and down reversal arrows, and colors bars when a short-term extreme coincides wit

Strategy v5 TrendMoving averages Repaints
Updated 6 weeks ago · None stated GitHub repository of SPY Options Trading - Alert

Quick Flip Scalper

by TradersPost
228 stars

This strategy executes an opening-range liquidity fade based on the first candle of a session. It qualifies the opening range against the daily ATR to confirm manipulation or liquidity spikes. If qualified, it searches for reversal candlestick patterns, such a

Strategy v6 Sessions & timeCandlestick patterns
Updated 3 months ago · None stated GitHub repository of Quick Flip Scalper

Doji Star - Bullish

by TWODS-CAPITAL
37 stars

This indicator marks a bullish Doji Star on the price chart. It looks for a downtrend, a long black candle, and a following doji whose body sits below the prior candle body. Trend detection can use a 50-period SMA, both 50- and 200-period SMAs, or no filter. A

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Doji Star - Bullish

This indicator detects multi-timeframe Liquidity Engulfing Candles directly on the price chart. It evaluates bullish and bearish engulfing patterns augmented by optional stop hunt wick filters and close breakout conditions across H1, H4, and current timeframes

Indicator v5 Candlestick patternsSMC / ICT / price action Repaints
Updated 2 months ago · None stated GitHub repository of Liquidity Engulfing & Displacement [MsF]

Raschke Patterns

by TradersPost
228 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

Engulfing Candle Micro-Gaps

by Web3Degenerate
2 stars

The Engulfing Candle Micro-Gaps indicator identifies bullish and bearish engulfing candlestick patterns filtered by recent swing highs and swing lows. It introduces a configurable point allowance setting that accommodates minor price gaps between adjacent bars

Indicator v5 Candlestick patternsSupport & resistance
Updated 2 years ago · None stated GitHub repository of Engulfing Candle Micro-Gaps
3 stars

This Pine Script indicator plots Smart Money Concepts market structure directly on the price chart. It identifies swing highs and lows, internal market structures, Break of Structure events, Change of Character shifts, and EQH/EQL levels. Breaker blocs are hig

Indicator v5 SMC / ICT / price actionCandlestick patterns Repaints
Updated 12 months ago · None stated GitHub repository of SMC & Breaker Blocs [Krishna]

Fractal Engulfing Candles

by Web3Degenerate
2 stars

This indicator identifies bullish and bearish engulfing candlestick patterns filtered by fractal swing points and RSI momentum levels. It detects swing highs and lows over a configurable lookback period, requiring bullish signals to coincide with a swing low a

Indicator v5 Candlestick patternsOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Fractal Engulfing Candles
37 stars

This indicator detects the bearish Downside Tasuki Gap candlestick pattern on the price chart. It looks for a long red candle, a smaller red candle that gaps below it, and a green candle that closes inside that gap without filling it, while price is in a downt

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Downside Tasuki Gap - Bearish

Dragonfly Doji - Bullish

by TWODS-CAPITAL
37 stars

This overlay indicator marks a bullish dragonfly doji on the price chart. It treats a candle as a doji when the range is positive and the body is no larger than five percent of the range, then requires the upper shadow to be no larger than the body. On a match

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Dragonfly Doji - Bullish

Price Spike Detector

by ivansoft
1 stars

An indicator in a separate pane that measures candle wick sizes, the distance from the body to the high and to the low, and shows them as columns for the chart timeframe along with 15-minute and 60-minute versions requested with lookahead. Percentile levels ov

Indicator v6 Volatility & bandsCandlestick patterns Repaints
Updated 1 year ago · None stated GitHub repository of Price Spike Detector

Hammers & Shooting Stars

by Web3Degenerate
2 stars

This overlay indicator marks hammer and shooting star candles on the price chart. It places a Fibonacci level inside each candle and treats a hammer as a body sitting above the upper level and a shooting star as a body sitting below the lower level. Optional f

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Hammers & Shooting Stars

Engulfing - Bearish

by TWODS-CAPITAL
37 stars

This indicator identifies and labels bearish engulfing candlestick patterns directly on the price chart. It checks for a small bullish candle followed by a large bearish candle that engulfs the previous body. Pattern detection can be filtered using moving aver

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Engulfing - Bearish

TMA Overlay

by webcrack4
1 stars

TMA Overlay plots four smoothed moving averages of close, with lengths 21, 50, 100 and 200, on the price chart. The 100-period line can be hidden. It fills the area between a two-period EMA and the 200-period smoothed average green or red according to which is

Indicator v4 Moving averagesCandlestick patterns
Updated 9 months ago · None stated GitHub repository of TMA Overlay

Range Candles

by everget
947 stars

Plots custom-colored candlesticks directly over the price chart. It determines the direction of each bar by comparing the close price to the open price and colors the candle bodies, borders, and wicks accordingly. The user inputs allow customization of the bul

Indicator v4 Candlestick patterns
Updated 11 days ago · GPL-3.0 GitHub repository of Range Candles

Engulfing - Bullish

by TWODS-CAPITAL
37 stars

This indicator marks a bullish engulfing candlestick on the price chart. It requires a white long-body candle whose body covers the previous black small-body candle, and it can require a downtrend defined by price below a 50-period SMA or by the 50-period SMA

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Engulfing - Bullish

More Pine Script Categories

Browse the whole Pine Library

Third-party code. ForexR lists open-source Pine scripts from GitHub; it did not write, test or endorse them, and their summaries are generated automatically from each script's code and README. Indicators describe the past, and a strategy's backtest can look better than live trading. Check a script on a demo account before you rely on it. CFDs and leveraged forex are complex instruments with a high risk of losing money rapidly.

Learn to Use Pine Scripts

Free, plain-English guides: add a script to TradingView, read what it does, test it and avoid the common traps.

  1. 1Using this librarySearch, filters, licences and what the badges mean.
  2. 2Add a script to TradingViewCopy, paste into the Pine Editor, save and add to chart.
  3. 3Indicators, strategies and librariesWhat each type does and how to tell them apart.
  4. 4Spot a script that repaintsWhy some signals change after the bar closes.
  5. 5Backtest a strategyStrategy Tester settings that keep results honest.
  6. 6Send alerts to MT4 or MT5From a TradingView alert to an order in MetaTrader.
  7. 7What Pine Script isThe language, what it can and cannot do, and where to start.
  8. 8Write your first indicatorA complete script, line by line, in the Pine Editor.
  9. 9Read a script before you trust itA routine for checking inputs, logic and red flags.
  10. 10Edit a script safelyChange colours and lengths, add a filter or an alert.
  11. 11Pine Script alertsalertcondition(), alert(), placeholders and webhooks.
  12. 12Build a crossover strategyAn EMA cross strategy with an ATR stop, ready to test.

Trade Your Charts With a Regulated Broker

Compare regulated brokers on platforms, spreads, minimum deposit and leverage.

Compare brokers