Pine Library · 656 open-source scripts

Free Candlestick Pattern Pine Scripts (page 8)

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

Pro Pattern Al-Sat

by MeridianAlgo
9 stars

This overlay indicator marks bullish and bearish chart patterns on the price chart and can hide either side. Optional filters require agreement from fast and slow EMAs, Supertrend, and ADX, plus volume, RSI, nearby pivot support or resistance, and a user-defin

Indicator v6 Candlestick patternsTrend
Updated 4 months ago · MIT GitHub repository of Pro Pattern Al-Sat

HTF Candles & Pivots

by itmakesyousick
2 stars

HTF Candles & Pivots overlays higher-timeframe candlestick bars, pivot points, and price structure directly onto the main price chart. It renders customizable higher-timeframe candle bodies, wicks, and time division separators while calculating classic pivot l

Indicator v5 Candlestick patternsSupport & resistance
Updated 3 years ago · None stated GitHub repository of HTF Candles & Pivots

Types Demo

by Alaamo7
1 stars

Types Demo is an educational indicator designed to illustrate fundamental Pine Script variable types, including boolean, integer, float, string, and color. It checks whether the current bar is bullish and plots the closing price in green within a separate pane

Indicator v6 Candlestick patterns
Updated 2 months ago · Custom licence GitHub repository of Types Demo
1 stars

This Pine Script strategy combines bullish and bearish engulfing candlestick patterns detected on the price chart with a stochastic oscillator for entry signals. The stochastic is calculated using inputs for K period, D period, and smoothing. Long entries trig

Strategy v5 Candlestick patternsOscillators & momentum
Updated 7 months ago · None stated GitHub repository of Engulfing and Stochastic Strategy

IBOB Inside Bar Outside Bar

by Tradehook-org
1 stars

A Pine v5 strategy that trades an outside bar after one or more inside bars. An inside bar has a lower high and higher low than the bar before it, and an outside bar exceeds both. After the chosen number of consecutive inside bars, an outside bar closing up op

Strategy v5 Candlestick patternsBreakout
Updated 8 months ago · None stated GitHub repository of IBOB Inside Bar Outside Bar

Dual-color bars

by be-thomas
65 stars

This indicator draws a separate OHLC bar series in its own pane using plotbar. Each bar is colored lime when the close is greater than or equal to the open, and red when the close is below the open. It has no user inputs, no signals, and no entry, exit, stop,

Indicator v5 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of Dual-color bars
3 stars

This Pine Script v5 indicator detects spinning top candlestick patterns by comparing the real body size to user-defined min and max thresholds as percentages of the candle's range. It signals bullish spinning tops with a white arrow below the bar and bearish o

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Spinning Top (Candlestick Pattern)

Previous Candle Theory

by wynnforthework
2 stars

This strategy enters trades based on consecutive candle directions relative to a chosen moving average filter. It triggers a long entry when both the current and previous candles close bullish above the moving average, and a short entry when both candles close

Strategy v5 TrendMoving averages
Updated 1 year ago · None stated GitHub repository of Previous Candle Theory

HTF Candles & Pivots

by itmakesyousick
2 stars

Plots higher-timeframe candlestick overlays and pivot points directly on the price chart. It draws HTF candle bodies and wicks using boxes and lines across custom or auto-selected higher timeframes. The indicator can also compute and display traditional pivot

Indicator v5 Candlestick patternsSupport & resistance
Updated 3 years ago · None stated GitHub repository of HTF Candles & Pivots

Hammers and Stochastic Strategy

by gabriel-klettur
1 stars

Hammers and Stochastic Strategy overlays signals on the price chart by combining candlestick pattern detection with the Stochastic oscillator. It identifies standard hammer and inverted hammer candles and validates them with Stochastic oversold and overbought

Strategy v5 Candlestick patternsOscillators & momentum
Updated 7 months ago · None stated GitHub repository of Hammers and Stochastic Strategy

ETHUSDT Binance 5m

by tseitz
1 stars

The script calculates multiple offset VWAP lines alongside Doji candle filters to generate trading signals on a five-minute cryptocurrency chart. It identifies bullish entry conditions when non-Doji green candles break above upper VWAP thresholds, and bearish

Strategy v4 Moving averagesCandlestick patterns
Updated 4 years ago · None stated GitHub repository of ETHUSDT Binance 5m
43 stars

This indicator builds a synthetic Heikin-Ashi series using only the current open and the opens of the previous three bars. It derives open, high, low, and close from those values, rounds each price to the symbol mintick, and plots the result as candles in a se

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Heikin-Ashi Open Only

|AG| Project

by Anderson-ALGO
9 stars

|AG| Project is a Pine Script v4 indicator that draws four mini charts in a separate pane. It requests open, high, low, and close for user-selected symbols, rescales those values with a stochastic calculation, and plots an exponential moving average of each sc

Indicator v4 Screeners & dashboardsCandlestick patterns
Updated 5 years ago · None stated GitHub repository of |AG| Project

Cerebr Bloop

by jerryinyang
5 stars

Cerebr Bloop is a momentum oscillator calculated by applying Heikin-Ashi candle logic to a zero-centered Relative Strength Index (RSI). Displayed in a separate pane, it visualizes smoothed RSI momentum candles alongside customizable overbought and oversold thr

Indicator v4 Oscillators & momentumCandlestick patterns
Updated 2 years ago · None stated GitHub repository of Cerebr Bloop

HTF Candles & Pivots

by itmakesyousick
2 stars

This indicator overlays higher-timeframe candles and traditional pivot levels on the price chart. It draws open-close or high-low ranges with optional wicks, thickness, filled negative candles, and bar coloring. History can show only new candles, all candles,

Indicator v5 Support & resistanceCandlestick patterns
Updated 3 years ago · None stated GitHub repository of HTF Candles & Pivots

RB Rejection Blocks

by Ahmed1926
1 stars

A simple overlay indicator that marks rejection blocks from three-candle price structure. A bullish block is a down candle whose low is lower than the candles on both sides, and a bearish block is an up candle whose high is higher than both neighbours. Each bl

Indicator v5 SMC / ICT / price actionCandlestick patterns
Updated 9 months ago · None stated GitHub repository of RB Rejection Blocks

Commitment Gauge

by harryguiacorn
220 stars

This indicator measures directional momentum by evaluating candlestick body proportions and volume over a user-defined lookback window. It computes the ratio of candle body to total range, weights the cumulative value by volume and absolute body size, and dete

Indicator v4 VolumeCandlestick patterns
Updated 1 year ago · None stated GitHub repository of Commitment Gauge

Example 2

by be-thomas
65 stars

An educational indicator from TradingView documentation that demonstrates how to render custom price bars using the plotbar function. It evaluates whether the close is greater than or equal to the open on each bar to determine a bullish or bearish status. Bars

Indicator v5 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of Example 2

BarUpDn Strategy

by TWODS-CAPITAL
37 stars

This strategy trades on the price chart from the current bar versus the prior close. It enters long when the bar closes above its open and that open is above the previous close, and enters short when the bar closes below its open and that open is below the pre

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

Smart Trader Episode 03 divides a specified lookback window into bar groups or blocks on the main price chart. It calculates aggregated composite OHLC candles for each block, draws structural group boxes, and identifies trend segments using custom angle thresh

Indicator v6 TrendCandlestick patterns
Updated 4 months ago · MIT GitHub repository of Smart Trader Ep 03 - Candles and Tradelines
3 stars

Candle Body Wick Alerts identifies candles with minimal or missing wicks based on comparisons between open, high, low, and close values. It checks if the price distance between key levels (such as open and low or high and close) falls within a set tolerance th

Indicator v5 Candlestick patternsSupport & resistance
Updated 5 months ago · None stated GitHub repository of Candle Body Wick Alerts
3 stars

This indicator identifies Tweezer Top and Tweezer Bottom candlestick reversal patterns directly on the price chart. It checks for matching bar highs or lows across consecutive candles while filtering out doji or weak candles based on user-defined threshold per

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Tweezer Top/Bottom Pattern

Pinbar Strategy

by Web3Degenerate
2 stars

This strategy identifies pin bar candlestick patterns, specifically hammer and shooting star candles, to trigger trade entries. It detects candle shapes based on a customizable Fibonacci threshold. Signals can be filtered using minimum and maximum ATR candle s

Strategy v5 Candlestick patternsTrend
Updated 2 years ago · None stated GitHub repository of Pinbar Strategy
1 stars

Reads candle sequences and labels them as rally, base or drop phases, then flags four patterns: rally-base-drop, rally-base-rally, drop-base-drop and drop-base-rally. Each pattern can be switched on or off. Bars can be coloured fully, only on detection, or not

Indicator v6 Support & resistanceCandlestick patterns
Updated 6 months ago · None stated GitHub repository of Rally Base Drop Signals

Higher Close and Lower Close

by fiji-solutions
1 stars

Higher Close and Lower Close is an overlay indicator that highlights simple single-candle price action signals. It monitors whether the current bar closes above the preceding bar's high or below the preceding bar's low. When a close exceeds the previous high,

Indicator v5 Candlestick patternsBreakout
Updated 2 years ago · None stated GitHub repository of Higher Close and Lower Close

Quantity Quality Commitment

by harryguiacorn
220 stars

The Quantity Quality Commitment indicator evaluates market momentum across three dimensions in a separate chart pane. It measures quantity by counting bullish and bearish candles over a lookback window, assesses quality by analyzing the ratio of candle bodies

Indicator v4 Oscillators & momentumCandlestick patterns
Updated 1 year ago · None stated GitHub repository of Quantity Quality Commitment

Heikin Ashi Delta Smoothed

by lunarticktrading
7 stars

This indicator calculates the difference between Heikin-Ashi close and open values to quantify directional candle spread. It smooths this delta value using a simple moving average and plots the resulting oscillator as a line in a separate pane. Traders can cus

Indicator v6 Oscillators & momentumCandlestick patterns
Updated 2 weeks ago · None stated GitHub repository of Heikin Ashi Delta Smoothed

Candles In a Row

by g-moe
3 stars

This indicator tracks consecutive bullish and bearish candles on the main price chart. It counts consecutive closes relative to opens and plots a green triangle below the bar or a red triangle above the bar once a streak reaches the chosen target length on a c

Indicator v5 Candlestick patterns
Updated 5 months ago · None stated GitHub repository of Candles In a Row

Pinbar Strategy

by Web3Degenerate
2 stars

Pinbar Strategy identifies pinbar candlestick patterns (hammers and shooting stars) via the imported ZenLibrary and trades reversals or continuations on confirmed bars. Entries are filtered by an optional exponential moving average and candle range thresholds

Strategy v5 Candlestick patternsTrend
Updated 2 years ago · None stated GitHub repository of Pinbar Strategy

HTF Candles & Pivots

by itmakesyousick
2 stars

Plots higher-timeframe candle overlays and pivot point levels directly onto the main price chart. It renders higher-timeframe open, high, low, and close levels as custom boxes with optional wicks, alongside traditional pivot points, support and resistance leve

Indicator v5 Support & resistanceCandlestick patterns
Updated 3 years ago · None stated GitHub repository of HTF Candles & Pivots

Turtle Trading Strategy

by GreyssonEnterprises
1 stars

This strategy overlays four smoothed moving averages and a trend fill between a two-period EMA and the longest average on the price chart. It marks optional three-line strike and engulfing candle patterns. Inputs set a Donchian channel length, the four average

Strategy v5 TrendMoving averages
Updated 2 months ago · MIT GitHub repository of Turtle Trading Strategy

Five-in-one Strategy

by capissimo
114 stars

Five-in-one Strategy combines five analytical tools into a single price chart overlay: the Dual Thrust Trading Algorithm (DTTA), Semafore, HalfTrend, Nick Rypock Trailing Reverse, and Tweezer or Kangaroo Tail candlestick patterns. It generates trade signals us

Indicator v4 TrendBreakout Repaints
Updated 1 year ago · None stated GitHub repository of Five-in-one Strategy

Heikin Ashi Dots

by lunarticktrading
7 stars

Heikin Ashi Dots calculates trend momentum using Heikin-Ashi candle values retrieved across a customizable timeframe. It evaluates the relationship between the open and close of the current and prior Heikin-Ashi bars, plotting a horizontal series of colored ci

Indicator v6 TrendCandlestick patterns
Updated 2 weeks ago · None stated GitHub repository of Heikin Ashi Dots

CCI + Stoch + HA

by g-moe
3 stars

This indicator combines three momentum and trend analysis tools into a separate pane: a multi-timeframe Commodity Channel Index (CCI), a multi-timeframe Stochastic Oscillator, and a dual-EMA smoothed Heikin-Ashi trend bias displayed as colored dots. Users can

Indicator v5 Oscillators & momentumTrend Repaints
Updated 5 months ago · None stated GitHub repository of CCI + Stoch + HA

HTF Candles & Pivots

by itmakesyousick
2 stars

Plots higher-timeframe (HTF) candle overlays, pivot point levels, and time division markers directly on the price chart. It renders HTF candle bodies and wicks with configurable fills, alongside traditional pivot calculations, Central Pivot Range (CPR), and ex

Indicator v5 Support & resistanceCandlestick patterns
Updated 3 years ago · None stated GitHub repository of HTF Candles & Pivots

Heikin Ashi Trend

by Basant1Saini
1 stars

Heikin Ashi Trend is a trend-following strategy that calculates Heikin Ashi candle values and moving averages directly on the main price chart. It generates long and short entry signals when a user-defined number of consecutive Heikin Ashi bars align with fast

Strategy v5 TrendMoving averages
Updated 7 months ago · None stated GitHub repository of Heikin Ashi Trend
1 stars

This strategy detects bounces from support and resistance levels using swing pivot highs and lows. It waits for the price to touch an identified pivot level within a user-defined percentage tolerance and confirms an entry when a rejection candlestick forms, ch

Strategy v5 Support & resistanceCandlestick patterns
Updated 8 months ago · None stated GitHub repository of Springboard Algo (S/R Bounce)

Piercing Line & Dark Cloud

by fiji-solutions
1 stars

This Pine Script indicator plots the 50 percent mark of the previous bar's range and detects Piercing Line bullish reversal and Dark Cloud bearish reversal candlestick patterns. It uses a 7-period RSI filter where signals require RSI below 30 for bullish and a

Indicator v5 Candlestick patterns
Updated 2 years ago · None stated GitHub repository of Piercing Line & Dark Cloud

80-20

by hasnocool
106 stars

Identifies the 80-20 candlestick setup, triggering when a bar opens in the lower 20% of its total range and closes in the upper 20%, or opens in the upper 20% and closes in the lower 20%. Blue and red arrows plot above qualifying bars directly on the price cha

Strategy v5 Candlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of 80-20

Holiday candles

by be-thomas
65 stars

Holiday candles is a Pine Script v5 overlay indicator that recolors price candles. It builds a color from random red, green, and blue values and a random transparency level using color.rgb, then draws each bar with plotcandle from the open, high, low, and clos

Indicator v5 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of Holiday candles
1 stars

A strategy that scores signals from ten sources: RSI, MACD, Bollinger Bands, head and shoulders, wedges, multiple tops and bottoms, candlestick reversals, pivot support and resistance, volume spikes and an EMA ribbon filter. A trade needs a minimum pattern sco

Strategy v5 Oscillators & momentumCandlestick patterns
Updated yesterday · None stated GitHub repository of Fall Strategy 10-Pattern Engine

Inside Bar Breakout

by Basant1Saini
1 stars

Inside Bar Breakout identifies standard and double inside bar candlestick patterns to trade breakout momentum. It sets trigger levels using reference bar extremes plus an adjustable percentage buffer. Once a pattern forms, the strategy waits up to five bars fo

Strategy v5 Candlestick patternsBreakout
Updated 7 months ago · None stated GitHub repository of Inside Bar Breakout
1 stars

An indicator that detects classic candlestick patterns and marks them with labels on the price chart. Patterns include engulfing, hammer, shooting star, doji variants, morning and evening stars, harami cross, dark cloud cover and piercing. Each pattern can be

Indicator v5 Candlestick patterns
Updated 1 year ago · None stated GitHub repository of Candlestick Patterns

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