Pine Library · 656 open-source scripts

Free Candlestick Pattern Pine Scripts (page 11)

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

P_fmt_tabs_mixed

by GammaExpansion
1 stars

P_fmt_tabs_mixed is an indicator that tracks net candle direction by maintaining a running cumulative counter. It increments the counter by one on bullish bars where the closing price exceeds the opening price, and decrements it by one on bearish bars where th

Indicator v6 Candlestick patternsOscillators & momentum
Updated 6 days ago · MIT GitHub repository of P_fmt_tabs_mixed
228 stars

This strategy identifies trade opportunities based on candlestick wick imbalances relative to the Average True Range. It enters positions when candle wicks exceed defined thresholds and filters out doji candles using a minimum body ATR requirement. Exits are h

Strategy v6 Candlestick patternsVolatility & bands Repaints
Updated 3 months ago · None stated GitHub repository of Super Negative R:R Wick Strategy
1 stars

This indicator computes the average height of green and red candles inside a user-selected time range. Inputs define start and end timestamps that filter candle data in real time. When the range is active the script accumulates heights for green candles (where

Indicator v5 Support & resistanceCandlestick patterns
Updated 7 weeks ago · None stated GitHub repository of Average Green/Red Candle Heights

Evening Doji Star - Bearish

by TWODS-CAPITAL
37 stars

This indicator detects the bearish Evening Doji Star candlestick pattern directly on the price chart. It checks for a three-bar pattern comprising a long bullish candle, a gapping doji body, and a long bearish candle closing below the midpoint of the first can

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

HMD Relative Strength Index

by Web3Degenerate
2 stars

Calculates a Relative Strength Index with user-defined length and overbought/oversold thresholds. It identifies exhaustion setups by pairing momentum extremes with bullish and bearish engulfing candlestick patterns imported from an external library. Buy signal

Indicator v5 Oscillators & momentumCandlestick patterns
Updated 2 years ago · None stated GitHub repository of HMD Relative Strength Index

Barcolor Example

by be-thomas
65 stars

This indicator highlights specific candlestick formations directly on the price chart by coloring the bars. It detects inside bars, coloring them yellow, as well as bullish outside bars in aqua and bearish outside bars in purple. Bars that do not meet these co

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of Barcolor Example

Evening Star - Bearish

by TWODS-CAPITAL
37 stars

The Evening Star - Bearish indicator identifies and marks the three-candle Evening Star bearish reversal pattern directly on the main price chart. It detects a strong bullish candle, followed by a small-bodied gapping candle, and finishes with a strong bearish

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

HMD Session Candles

by Web3Degenerate
2 stars

This Pine Script indicator plots session summary bars on the price chart for Tokyo, London, and New York sessions. It tracks open, high, low, and close values for each session period defined by user inputs. At session start and end, it draws purple bars showin

Indicator v5 Sessions & timeCandlestick patterns
Updated 2 years ago · None stated GitHub repository of HMD Session Candles

Sweep and Engulf Strategy

by rosijay17-cmd
1 stars

A strategy that looks for a one-bar sweep and engulf pattern: a bar that takes out the previous low and closes above the previous high is bullish, and the mirror case is bearish. By default the trades are inverted, so a bullish pattern opens a short and a bear

Strategy v6 Candlestick patternsSMC / ICT / price action
Updated 7 days ago · GPL-3.0 GitHub repository of Sweep and Engulf Strategy
37 stars

This indicator identifies the five-candle bearish continuation pattern known as the Falling Three Methods on the main price chart. It checks for an initial long bearish candle within a downtrend, three consecutive small bullish candles contained within the fir

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Falling Three Methods - Bearish

HMD Stochastic

by Web3Degenerate
2 stars

This indicator plots the Stochastic oscillator with %K in blue and %D in orange lines. It calculates the values using SMA on the Stoch function based on user inputs for %K length, %K smoothing, and %D smoothing. Long signals trigger on bullish engulfing candle

Indicator v5 Oscillators & momentumCandlestick patterns
Updated 2 years ago · None stated GitHub repository of HMD Stochastic

P_syn_drawings

by GammaExpansion
1 stars

This Pine Script v6 indicator draws multiple objects on the price chart for testing. It creates a red dashed line from the previous low to the current low, a blue line from the previous high to the current high, and connects their endpoints. A green label show

Indicator v6 Support & resistanceCandlestick patterns
Updated 6 days ago · MIT GitHub repository of P_syn_drawings
257 stars

This indicator detects a large set of classic candlestick patterns and plots colored labels on the price chart. Trend context uses a 50-period simple moving average, or the 50 and 200 averages stacked together, and can be switched off. Users filter bullish, be

Indicator v4 Candlestick patternsTrend
Updated 6 weeks ago · None stated GitHub repository of Snag - All Candlestick Patterns

Falling Window - Bearish

by TWODS-CAPITAL
37 stars

This indicator identifies the bearish falling window candlestick pattern, a two-candle continuation setup where a downward price gap occurs during a downtrend. It validates the pattern when the current bar's high is strictly lower than the previous bar's low u

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

Ichimoku Cloud

by Web3Degenerate
2 stars

This indicator calculates and overlays standard Ichimoku Cloud components on the price chart, including the Conversion Line, Base Line, Lagging Span, and Leading Spans A and B. It imports an external library to detect candlestick patterns like hammers and shoo

Indicator v5 TrendSupport & resistance
Updated 2 years ago · None stated GitHub repository of Ichimoku Cloud
1 stars

The Complex Pattern Finder indicator scans price charts for specific sequences of bullish and bearish candlesticks encoded as binary strings. Users can enter a custom string of ones and zeros or enable an auto-generated Fibonacci sequence based on a chosen lev

Indicator v5 Candlestick patterns
Updated 7 weeks ago · None stated GitHub repository of Complex Pattern Finder

Gravestone Doji - Bearish

by TWODS-CAPITAL
37 stars

This indicator scans price bars for a bearish gravestone doji on the price chart. It treats a candle as a doji when the body is small relative to the full range, then requires the lower shadow to be no larger than the body. On a match it draws a GD label above

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Gravestone Doji - Bearish
3 stars

This indicator identifies price action reversal setups by combining candlestick patterns with Exponential Moving Average (EMA) trend filters. It calculates two customizable EMAs (default 10 and 20 periods) and fills the area between them to form an EMA cloud.

Indicator v5 Candlestick patternsMoving averages
Updated 5 months ago · None stated GitHub repository of Engulfing Patterns
2 stars

This indicator detects liquidity sweeps during the Asian session and identifies reversal opportunities in the New York session. It tracks the high and low of the Asia trading range using session timestamps in UTC+3. Sweep up and down are flagged when price bre

Indicator v5 SMC / ICT / price actionSessions & time
Updated 2 months ago · None stated GitHub repository of Asian Liquidity Sweep + NY Reversal

Piercing Line & Dark Cloud

by Web3Degenerate
2 stars

This indicator identifies bullish Piercing Line and bearish Dark Cloud candlestick patterns directly on the price chart. It calculates the midpoint of the preceding candle and checks for directional candle closes along with opening gap conditions. To filter fa

Indicator v5 Candlestick patternsOscillators & momentum
Updated 2 years ago · None stated GitHub repository of Piercing Line & Dark Cloud
3 stars

This indicator identifies pullback reversal setups by combining dual exponential moving averages with candlestick patterns. It plots two EMAs with a shaded cloud to define trend direction. When price touches or crosses the slower EMA and closes back in trend a

Indicator v5 Candlestick patternsMoving averages
Updated 5 months ago · None stated GitHub repository of Engulfing Patterns

Hammer - Bullish

by TWODS-CAPITAL
37 stars

This indicator marks a bullish hammer candlestick on the price chart. It looks for a small real body above the bar midpoint, a lower shadow at least twice the body, and no upper shadow. A trend filter can require price below a 50-period SMA, below both a 50-pe

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

Fauna Dual Mode 2.0

by nishpa800
1 stars

Overlay indicator that classifies candles into seven families: momentum blast, range expansion, gap and go, trend accelerant, trapdoor reversal, exhaustion spike and gap and recover. Each family uses ATR multiples, body-to-range ratios and volume against its a

Indicator v5 Candlestick patternsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Fauna Dual Mode 2.0
330 stars

Exceeded Candle [Alorse] is a mean-reversion strategy that identifies candlestick engulfing patterns combined with Bollinger Bands filters. It enters a long position when a green candle surpasses the body of the previous red candle while price is below the mid

Strategy v4 Mean reversionCandlestick patterns
Updated 2 months ago · None stated GitHub repository of Exceeded candle [Alorse]

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

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

Tick-chart-safe overlay indicator that classifies candles into seven families: momentum blast, range expansion, gap and go, trend accelerant, trapdoor reversal, exhaustion spike and gap and recover. Each family uses ATR multiples, body-to-range ratios and volu

Indicator v5 Candlestick patternsOscillators & momentum
Updated 2 months ago · None stated GitHub repository of Fauna Dual Mode 2.0 Tick-Friendly

Harami - Bearish

by TWODS-CAPITAL
37 stars

This indicator detects a bearish Harami candlestick pattern on the price chart. It requires a long bullish candle in an uptrend followed by a smaller bearish candle whose range sits inside the previous body. Trend context is optional and uses a 50-period SMA,

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

Harami - Bullish

by TWODS-CAPITAL
37 stars

This indicator identifies and highlights Bullish Harami candlestick patterns on the price chart. A Bullish Harami occurs when a small-bodied green candle is completely encompassed within the body of the preceding long red candle during a downtrend. The underly

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

Impulse Candles

by eddiebelaval
7 stars

Impulse Candles identifies unusually large price bars relative to an Average True Range baseline. It measures candle body size against a user-defined ATR ratio and optionally filters for reversal setups following two consecutive candles of the opposite directi

Indicator v6 Volatility & bandsCandlestick patterns
Updated 3 months ago · None stated GitHub repository of Impulse Candles

Harami Cross - Bearish

by TWODS-CAPITAL
37 stars

This indicator identifies the bearish Harami Cross candlestick pattern on the price chart. The pattern consists of a long bullish candle followed by a Doji whose entire high-to-low range is contained within the real body of the preceding candle. Trend directio

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Harami Cross - Bearish
7 stars

This strategy detects an inside bar when the current high and low sit inside the previous bar. A bullish inside bar enters long and a bearish inside bar enters short, both on the price chart. The long stop is the entry bar low and the short stop is the entry b

Strategy v6 Candlestick patterns
Updated 3 months ago · None stated GitHub repository of Inside Bar Strategy with SL/TP

Bar Color

by hasnocool
106 stars

Bar Color is a simple candle-based reversal strategy displayed directly on the price chart. It checks the relationship between the bar close and open prices. On a bullish candle, it triggers a long entry and exits any active short position. On a bearish candle

Strategy v5 Candlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of Bar Color

VWAP and VWMA

by Web3Degenerate
2 stars

This indicator plots either a Volume Weighted Average Price (VWAP) or a Volume Weighted Moving Average (VWMA) directly on the price chart, coloring the line based on whether the close is above or below it. It generates trading signals by combining the trend fi

Indicator v5 Moving averagesCandlestick patterns
Updated 2 years ago · None stated GitHub repository of VWAP and VWMA
1 stars

This indicator plots detrended candlesticks in a separate pane relative to a chosen baseline to highlight market cycles around a zero line. Users can switch the baseline mode between a moving average and high/low extremes. In moving average mode, it subtracts

Indicator v5 Moving averagesOscillators & momentum
Updated 7 weeks ago · None stated GitHub repository of Detrended Candles (Switchable)

Zen Library Patterns

by Web3Degenerate
2 stars

This indicator imports the Zen Library and uses it to detect several candlestick reversal patterns on the price chart. It identifies bullish and bearish engulfing candles, hammers, stars, and dojis, then plots corresponding shape markers with labels. The libra

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Zen Library Patterns

Pin Bar Magic v1

by Alorse
330 stars

This strategy trades price action pin bar patterns aligned with moving average trend alignment on the main price chart. It defines uptrends or downtrends using a fan arrangement of three moving averages (6 EMA, 18 EMA, and 50 SMA). Entry conditions require a b

Strategy v4 Candlestick patternsTrend
Updated 2 months ago · None stated GitHub repository of Pin Bar Magic v1

InSide Bar Strategy

by TWODS-CAPITAL
37 stars

This strategy detects an inside bar when the current high is below the previous high and the current low is above the previous low. It enters long when that bar's close is above its open and short when the close is below its open. Signals are placed on the pri

Strategy v5 Candlestick patterns Repaints
Updated 3 years ago · MIT GitHub repository of InSide Bar Strategy

Inverted Hammer - Bullish

by TWODS-CAPITAL
37 stars

Detects bullish inverted hammer candlestick patterns directly on the price chart. It identifies candles with a small real body in the lower half of the range, an upper shadow at least twice the body length, and a minimal lower shadow occurring in a downtrend.

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Inverted Hammer - Bullish

PSMC - Bar Wick & Border Color

by Web3Degenerate
2 stars

This indicator customizes candle appearance on the price chart using plotcandle. Bullish candles appear in green with blue wicks and lime borders. Bearish candles appear in maroon with orange wicks and red borders. The script directly plots these colored candl

Indicator v4 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of PSMC - Bar Wick & Border Color

Kicking - Bearish

by TWODS-CAPITAL
37 stars

This indicator identifies and highlights bearish kicking candlestick patterns directly on the price chart. It searches for a two-bar formation consisting of a bullish marubozu followed by a bearish marubozu that opens with a gap down below the prior candle's l

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Kicking - Bearish

Kicking - Bullish

by TWODS-CAPITAL
37 stars

This indicator detects a bullish kicking candlestick pattern on the price chart. It marks a two-candle sequence in which the prior candle is a black marubozu and the current candle is a white marubozu that gaps above the prior high. A K label is drawn below th

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

PSMC - Splitting Alerts

by Web3Degenerate
2 stars

This indicator demonstrates how to configure and separate multiple alert triggers using input toggles. It calculates a 7-period RSI to identify overbought and oversold conditions, alongside candlestick confirmations when price closes against the extreme. Signa

Indicator v4 Oscillators & momentumCandlestick patterns
Updated 2 years ago · None stated GitHub repository of PSMC - Splitting Alerts
3 stars

The Heikin Ashi Buy Sell Arrows indicator calculates custom Heikin-Ashi values on the current chart to identify potential trend reversals. A buy signal is generated when a Heikin-Ashi candle forms with no lower wick following a sell sequence, while a sell sign

Indicator v5 Candlestick patternsTrend
Updated 5 months ago · None stated GitHub repository of Heikin Ashi Buy Sell Arrows

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

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