Pine Library · 656 open-source scripts

Free Candlestick Pattern Pine Scripts (page 13)

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

1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns. A lookback setting decides when a zone is invalidated, a tolerance margin allows small breaches, and a long term mode keeps more zones. Algorithm modes range from looser to strict

Indicator v5 Support & resistanceCandlestick patterns
Updated 6 months ago · None stated GitHub repository of Supply and Demand Zones V4

OutSide Bar Strategy

by TWODS-CAPITAL
37 stars

The OutSide Bar Strategy identifies outside bar candlestick patterns directly on the main price chart. It triggers a long entry when a bar's high exceeds the previous high and its low drops below the previous low, provided the bar closes higher than its open.

Strategy v5 Candlestick patternsBreakout
Updated 3 years ago · MIT GitHub repository of OutSide Bar Strategy
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns. A lookback setting decides when a zone is invalidated, a tolerance margin allows small breaches, and a long term mode keeps more zones. Algorithm modes range from looser to strict

Indicator v5 Support & resistanceCandlestick patterns
Updated 6 months ago · None stated GitHub repository of Supply and Demand Zones V4
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns, in a version labelled stable by its file name. Settings set how many bars back removal of invalidated zones begins, how much history is kept after invalidation, and a tolerance ma

Indicator v5 Support & resistanceCandlestick patterns
Updated 6 months ago · None stated GitHub repository of Supply and Demand Zones V4

This Pine Script strategy detects bullish engulfing candlestick patterns to generate buy and sell signals overlaid directly on the price chart. It supports backtesting over a user-defined date range with inputs for profit target, stop loss percentage, order si

Strategy v5 Candlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of Buy&Sell Bullish Engulfing - The Quant Science
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns. Settings set how many bars back removal of invalidated zones begins, how much history is kept after invalidation, and a tolerance margin. A long term mode keeps more zones. Algori

Indicator v5 Support & resistanceCandlestick patterns
Updated 6 months ago · None stated GitHub repository of Supply and Demand Zones V4

Holiday Candles

by be-thomas
65 stars

Holiday Candles is a visual demonstration script from TradingView documentation that renders price candlesticks with randomized colors. For each bar, it generates pseudo-random values for red, green, blue, and transparency levels to construct a dynamic RGB col

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of Holiday Candles

Piercing - Bullish

by TWODS-CAPITAL
37 stars

Identifies the two-candle bullish Piercing Line reversal pattern during a downtrend directly on the price chart. It checks for a long bearish candle followed by a bullish candle opening at or below the prior low and closing above its midpoint. Users can filter

Indicator v5 Candlestick patternsTrend
Updated 3 years ago · MIT GitHub repository of Piercing - Bullish
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns, split into two zone types: one where price breaks the zone high or low, and one where only the open is broken. Each type has its own maximum count, and a tolerance margin allows s

Indicator v5 Support & resistanceCandlestick patterns
Updated 6 months ago · None stated GitHub repository of Supply and Demand Zones V4
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns, split into two zone types: one where price breaks the zone high or low, and one where only the open is broken. Each type has its own maximum count, and a tolerance margin allows s

Indicator v5 Support & resistanceCandlestick patterns
Updated 6 months ago · None stated GitHub repository of Supply and Demand Zones V4

Electrocardiogram Chart

by regalouisei
2 stars

This indicator reimagines price action as an electrocardiogram wave directly on the main chart pane. It converts standard bar data into heartbeat-style paths using custom data structures, plotting interconnected line segments that link open, internal swing, an

Indicator v5 Candlestick patterns
Updated 8 months ago · None stated GitHub repository of Electrocardiogram Chart

This overlay indicator draws rounded psychological price levels and optional PVSRA vector candle colors on the price chart. It plots quarter, half, and whole levels from a user-set rounding value, with separate color, line style, and width for each. Vector col

Indicator v5 Support & resistanceVolume
Updated 5 months ago · None stated GitHub repository of Level Theory + Vector Candles
7 stars

This indicator plots Smart Money Concepts and price action components directly on the price chart. It highlights bullish and bearish order blocks, multi-timeframe pivot points, market structure swings with key Fibonacci retracement levels (0.618 and 0.786), zo

Indicator v5 SMC / ICT / price actionSupport & resistance Repaints
Updated 3 months ago · None stated GitHub repository of Cryptokazancev Strategy Pack

Test 019 Tuple Security

by ricardosantos79
261 stars

This script plots multi-timeframe OHLC candlesticks in a separate chart pane using tuple security data fetching. It extracts open, high, low, and close prices from a user-specified timeframe, defaulting to Monthly, using a tuple-returning function. Traded valu

Indicator v4 Candlestick patterns Repaints
Updated 4 years ago · None stated GitHub repository of Test 019 Tuple Security
37 stars

This overlay indicator detects the bullish Rising Three Methods continuation pattern on the price chart. It looks for a long white candle, three small black candles whose bodies stay inside the first candle’s range, and a long white candle that closes above th

Indicator v5 Candlestick patternsTrend Repaints
Updated 3 years ago · MIT GitHub repository of Rising Three Methods - Bullish

My Script

by be-thomas
65 stars

This indicator stores the difference between close and open for the current bar and the five preceding bars in a float array. It then plots the value at array index four, which is the close-minus-open difference from four bars ago. The study draws that single

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

Rising Window - Bullish

by TWODS-CAPITAL
37 stars

This indicator detects a bullish Rising Window, a two-candle pattern in which the current low is above the previous high during an uptrend. It plots an RW label below price, tints the background, and fires an alert when the pattern appears. Trend context can u

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

My Script

by be-thomas
65 stars

This script plots candlesticks on the price chart using open, high, low, and close values. It colors the candle body green if close exceeds open and red otherwise, with black wicks and orange borders. The script uses the study function to define it as an indic

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of My Script
6 stars

This indicator draws six New York killzone boxes on the price chart, covering morning, afternoon, and opening windows plus their extended ranges. It detects order blocks, fair value gaps, and change-in-state-of-delivery marks on a selectable timeframe, and dra

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of NY SMC Suite Multi-Killzone

Shooting Star - Bearish

by TWODS-CAPITAL
37 stars

This indicator marks a bearish shooting star on the price chart. It looks for a small real body near the low, an upper shadow at least twice the body, and no meaningful lower shadow, and it only confirms the pattern while price is in an uptrend. The trend filt

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

This strategy backtests hammer and star candlestick patterns on the price chart. It filters setups with an exponential moving average slope angle, optional swing high and low checks, and entry-candle size versus ATR. It opens one position at a time inside a us

Strategy v5 Candlestick patternsTrend
Updated 2 years ago · GPL-3.0 GitHub repository of NoSKi Hammer Star Backtester %

My Script

by be-thomas
65 stars

This indicator plots visual character markers directly on the price chart to identify bearish candles. It evaluates each bar and displays a symbol whenever the opening price is greater than the closing price. The script includes no user-configurable input para

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

Spinning Top Black

by TWODS-CAPITAL
37 stars

This overlay indicator detects a black spinning top on the price chart. It treats a candle as a match when the body is bearish, both the upper and lower shadows are at least 34 percent of the full range, and the body is not small enough to count as a doji. On

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Spinning Top Black

Spinning Top White

by TWODS-CAPITAL
37 stars

Spinning Top White is a price-chart indicator that marks a bullish spinning top. It treats a candle as a match when both shadows are at least 34 percent of the range, the body is not a doji, and the close is above the open. On a match it draws an STW label bel

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Spinning Top White

My Script

by be-thomas
65 stars

This Pine Script v4 educational indicator demonstrates dynamic label creation directly on the price chart. On every bar, the script instantiates a chart label and evaluates whether the bar closed higher than or equal to its open. For bullish bars, it renders a

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

My Script

by be-thomas
65 stars

My Script is a Pine Script v4 indicator that overlays the price chart. It compares each bar's open with its close and plots a bear character when the open is greater than the close, marking bearish candles. It does not calculate an oscillator, moving average,

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

HA: Heikin-Ashi

by mihakralj
99 stars

This indicator calculates and plots Heikin-Ashi smoothed candlesticks directly on the price chart. It derives the smoothed close from standard price averages and recursively computes the open, high, and low values. The script does not issue trade signals or al

Indicator v6 Candlestick patternsTrend
Updated 4 weeks ago · Apache-2.0 GitHub repository of HA: Heikin-Ashi

Three Black Crows - Bearish

by TWODS-CAPITAL
37 stars

This script identifies the Three Black Crows bearish reversal candlestick pattern directly on the price chart. It checks for three consecutive long red candles that open within the previous body, close consecutively lower, and feature minimal lower shadows com

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Three Black Crows - Bearish
106 stars

This Pine Script strategy identifies potential Buy Today, Sell Tomorrow (BTST) opportunities based on price action and volume patterns. It calculates a 20-period simple moving average of volume and checks for three consecutive bullish candles with higher highs

Strategy v4 TrendVolume
Updated 2 years ago · GPL-3.0 GitHub repository of 3 Higher High Price & Vol
37 stars

This indicator identifies and highlights the Three White Soldiers bullish reversal candlestick pattern on the price chart. It checks for three consecutive long-bodied bullish candles where each candle opens within the previous candle's body, closes above the p

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Three White Soldiers - Bullish

Tri-Star - Bearish

by TWODS-CAPITAL
37 stars

This indicator scans price charts to identify the Bearish Tri-Star candlestick pattern, which consists of three consecutive Doji candles appearing at the peak of an uptrend. It verifies trend context using simple moving averages (SMA 50 or SMA 200) or allows t

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

Tri-Star - Bullish

by TWODS-CAPITAL
37 stars

Identifies and highlights the Bullish Tri-Star candlestick pattern on the price chart. The indicator detects three consecutive doji candles following an established downtrend, determined by moving average trend rules (SMA 50, SMA 200, or disabled). When the pa

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of Tri-Star - Bullish
3 stars

Matt Moheeka Candles repaints price chart candles using custom color rules based on session timing and price action structures. It identifies and highlights session opening candles, long-wick reversal candles such as hammers or shooting stars, and doji pattern

Indicator v5 Candlestick patternsSessions & time
Updated 5 months ago · None stated GitHub repository of Matt Moheeka Candles

Tweezer Bottom - Bullish

by TWODS-CAPITAL
37 stars

This indicator detects Tweezer Bottom Bullish candlestick patterns on the price chart. It identifies a two-candle reversal during an uptrend, with the first candle long and red followed by a green candle with nearly identical lows. The script calculates trend

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

Tweezer Top - Bearish

by TWODS-CAPITAL
37 stars

This overlay indicator marks a two-candle Tweezer Top bearish reversal on the price chart. It looks for a prior long bullish candle in an uptrend followed by a bearish candle whose high is nearly the same as the previous high, using an EMA of candle body size

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

My Script

by be-thomas
65 stars

This indicator colors the background of its pane with a nested ternary that shows Pine line wrapping. It paints red when the bar open is above the close, lime when the high is above the previous bar high, and blue when the low is below the previous bar low. An

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of My Script

A Strategy for Leledec

by hasnocool
106 stars

This Pine Script strategy identifies major and minor Leledec exhaustion bars by tracking consecutive price bar comparisons against past closes and checking local extremes over set lookback lengths. It overlays visual markers directly on the price chart for det

Strategy v4 Mean reversionCandlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of A Strategy for Leledec

This strategy calculates and plots smoothed Heikin-Ashi candles directly onto the main price chart using exponential moving averages of open, high, low, and close prices. It enters a long position after three consecutive bullish smoothed candles with sequentia

Strategy v4 TrendMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Abdoli's Heikin Ashi Smoothed Buy & Sell Strategy Rev.4

PF Probe 98 - Inside-Bar Engulf

by pineforge-4pass
1 stars

PF Probe 98 - Inside-Bar Engulf is a strategy that detects single-bar inside range patterns paired with candle direction filters. It identifies inside bars where the high is lower than the previous high and the low is higher than the previous low. A long entry

Strategy v6 Candlestick patterns
Updated 6 days ago · Apache-2.0 GitHub repository of PF Probe 98 - Inside-Bar Engulf
106 stars

This strategy enters long on an outside bar when the candle is bullish, the Klinger Volume Oscillator is positive, and price is above a Hull moving average. It enters short on an inside bar when the candle is bearish, the oscillator is negative, and price is b

Strategy v4 Oscillators & momentumMoving averages Repaints
Updated 2 years ago · GPL-3.0 GitHub repository of Advanced OutSide Forex strategy

MTF Candles

by g-moe
3 stars

MTF Candles draws higher-timeframe candles on the price chart as boxes and lines. It can show up to five independent timeframes, each with its own enable switch, timeframe choice, and history length of one to fifty bars. Bullish and bearish bodies, borders, an

Indicator v5 Candlestick patterns
Updated 5 months ago · None stated GitHub repository of MTF Candles
3 stars

This indicator overlays multi-timeframe candlesticks on the current price chart. It pulls data from up to five selected higher timeframes and renders them as boxes with customizable body, border, and wick colors. Candles can be styled as regular or Heikin-Ashi

Indicator v5 Candlestick patternsTrend Repaints
Updated 5 months ago · None stated GitHub repository of MTF Candles + MAs
3 stars

This indicator overlays candles from multiple higher timeframes on the main price chart. It fetches OHLC data from timeframes 5, 15, 30, 60, and daily, displaying them clustered with customizable colors for bullish and bearish bodies, borders, and wicks. Selec

Indicator v5 Candlestick patternsMoving averages Repaints
Updated 5 months ago · None stated GitHub repository of MTF Candles + MAs

Plotshape Example 2

by be-thomas
65 stars

This educational script demonstrates how to plot custom shapes directly onto the price chart using Pine Script. It evaluates whether the close of the current bar is greater than or equal to its open. Bullish or neutral bars display a green upward triangle abov

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of Plotshape Example 2
3 stars

MTF Candles Price Levels overlays higher-timeframe reference lines and custom candle styling onto the main chart. It fetches higher-timeframe open and close prices to calculate configurable offset levels above key prices. Additional features include session fi

Indicator v5 Support & resistanceCandlestick patterns Repaints
Updated 5 months ago · None stated GitHub repository of MTF Candles Price Levels

MTF Charting

by g-moe
3 stars

This indicator plots multi-timeframe candlestick sequences directly on the price chart using boxes and lines. It projects historical candlesticks from up to five customizable higher timeframes alongside the current price action. Users can configure the timefra

Indicator v5 Candlestick patterns Repaints
Updated 5 months ago · None stated GitHub repository of MTF Charting

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