Pine Library · 656 open-source scripts

Free Candlestick Pattern Pine Scripts (page 12)

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_ver_when_param

by GammaExpansion
1 stars

This strategy enters a long position when the bar close is above its open. It has no inputs, no exit rules, and no stop loss or take profit. Position size is plotted in a separate pane rather than on the price chart. The script is a minimal parser fixture, so

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

YFI XBT Binance 1m

by tseitz
1 stars

This strategy plots a close VWAP and percentage-offset high and low VWAP bands on the price chart. It enters long when the bar opens above the high band, optionally only on a green candle, and short when the bar opens below the low band, optionally only on a r

Strategy v4 VolumeBreakout Repaints
Updated 4 years ago · None stated GitHub repository of YFI XBT Binance 1m

This strategy plots dual moving average clouds and a long-term trend filter directly on the price chart alongside Heikin Ashi data. It triggers long and short entry signals using moving average alignments and pivot trendline levels, with optional filtering via

Strategy v5 TrendMoving averages
Updated 5 months ago · None stated GitHub repository of Heikin Ashi with Pivot Trendlines Strategy

This strategy calculates double-smoothed Heikin Ashi candles and plots them directly on the price chart alongside a smoothed Relative Strength Index. It evaluates market conditions against external volatility data from an inverse symbol, generating long and sh

Strategy v5 Candlestick patternsOscillators & momentum
Updated 5 months ago · None stated GitHub repository of Heikin Ashi with Session Wicks Strategy

Marubozu Black - Bearish

by TWODS-CAPITAL
37 stars

This indicator detects a bearish black marubozu on the price chart. It treats a candle as a match when the close is below the open, the body is longer than a 14-period exponential average of body size, and both upper and lower shadows are at most five percent

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

This strategy plots smoothed Heikin Ashi candlesticks directly on the price chart. It filters entries using CCI and Stochastic crossovers calculated on a separate higher timeframe. Long signals trigger on CCI crossing above 60 and Stochastic crossing above its

Strategy v5 Candlestick patternsSessions & time Repaints
Updated 5 months ago · None stated GitHub repository of Heikin Ashi with Session Wicks Strategy

Example 2

by be-thomas
65 stars

This indicator renders custom OHLC bars in a separate chart pane using the plotbar function. It determines the color of each bar dynamically based on price action: bars where the closing price is greater than or equal to the opening price are colored lime, whi

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

Marubozu White - Bullish

by TWODS-CAPITAL
37 stars

This indicator detects a bullish white Marubozu on the price chart. It marks a white candle whose body is longer than a 14-bar exponential moving average of body size and whose upper and lower shadows are each no larger than five percent of that body. When the

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

Hercules Indicator 1.7 is a multi-filter trade signal generator designed to overlay entry conditions directly on the price chart. It evaluates engulfing candle patterns alongside multiple configurable filters, including trading session windows (Sydney, Tokyo,

Indicator v5 Candlestick patternsSessions & time
Updated 5 months ago · None stated GitHub repository of Hercules Indicator 1.7

My Script

by ricardosantos79
261 stars

This indicator plots a normalized candle dynamic visualization inside a custom 500x500 Gann square grid within a separate pane. It normalizes each bar's open and close prices relative to its high-low range, storing the resulting coordinate pairs in fixed-size

Indicator v5 Support & resistanceCandlestick patterns
Updated 4 years ago · None stated GitHub repository of My Script

Example 3

by be-thomas
65 stars

Example 3 is a basic demonstration indicator written in Pine Script v4 that illustrates how to plot custom candlesticks using the plotcandle function. It calculates a modified closing price by checking whether the bar is bullish, defined as the close being gre

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

Signal Quality Engine [WavesUnchained] is a range-fade indicator that identifies exhaustion at range extremes and signals potential reversals. It applies an ADX and EMA slope regime gate to stand down during strong trends. Using distance, structure, and moment

Indicator v6 Mean reversionSupport & resistance
Updated 2 days ago · MIT GitHub repository of Signal Quality Engine [WavesUnchained]

Hercules Rewrite

by g-moe
3 stars

Hercules Rewrite is a signal and visual trade management indicator that overlays entry setups directly on the price chart. It detects candle setups based on minimum tick movement and engulfing patterns, filtering entries through parameters like moving averages

Indicator v5 Candlestick patternsTrend
Updated 5 months ago · None stated GitHub repository of Hercules Rewrite

This strategy combines Bollinger %B settings with belthold and inner-candle color toggles and sizes orders as a percentage of equity. The user sets band length, source, and deviation, plus buy, sell, overbought, and oversold levels. Exits use either a modified

Strategy v5 Volatility & bandsCandlestick patterns
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands %B - Belthold & Inner Candles
3 stars

Hercules Strategy 1.7 is a price-chart strategy that gates trades with an engulfing-candle option, a lightning tick threshold, and a choice of long, short, or both directions. It can invert signals and stop the next trade from repeating the same side. Sydney,

Strategy v5 Candlestick patternsSessions & time
Updated 5 months ago · None stated GitHub repository of Hercules Strategy 1.7
261 stars

Bar Pattern Statistics Tool evaluates sequential candlestick formations and displays historical occurrence statistics in a separate pane. It classifies individual price bars into types such as inside bars, outside bars, up bars, down bars, and directional pin

Indicator v4 Candlestick patterns
Updated 4 years ago · None stated GitHub repository of [RS] Bar Pattern Statistics Tool

This indicator segments recent price bars into defined groups and visual boxes to serve as a visual chart ruler. It includes automated trend detection with configurable angle thresholds to plot uptrend, downtrend, and range segments directly on the price chart

Indicator v6 TrendSupport & resistance
6 stars

Forex Majors 4H Rejection Scanner tracks seven customizable currency pairs on a four-hour timeframe and displays their bias in a table overlay on the main price chart. It checks the last two closed four-hour candles for high or low price rejections, labeling a

Indicator v5 Screeners & dashboardsSupport & resistance Repaints
Updated 7 months ago · None stated GitHub repository of Forex Majors 4H Rejection Scanner
3 stars

Hercules Strategy Rewrite is an automated backtesting strategy that generates entry signals using engulfing candlestick patterns, tick thresholds, and support or resistance level breakouts. It offers multi-layer filtering including moving average trend checks,

Strategy v5 Candlestick patternsSessions & time
Updated 5 months ago · None stated GitHub repository of Hercules Strategy Rewrite
261 stars

This indicator tracks and analyzes custom candlestick bar sequences in a separate pane. Users can define a pattern sequence of up to ten consecutive bars using specific criteria such as inside bar, outside bar, up bar, down bar, pin bar, or any bar type. The s

Indicator v4 Candlestick patterns
Updated 4 years ago · None stated GitHub repository of [RS] Bar Pattern Statistics Tool

Historical Bar Match

by mikeyhu70
1 stars

This indicator compares the colour pattern of the latest bars, green or red by close, with up to a thousand bars of history. It looks for earlier matches and shows what followed them in a dashboard table on the chart, listing the matched dates and bars. Lookba

Indicator v5 Candlestick patternsScreeners & dashboards
Updated 6 months ago · None stated GitHub repository of Historical Bar Match

Example 5

by be-thomas
65 stars

This indicator retrieves Heikin Ashi candle data for the current symbol and plots the low price of the Heikin Ashi candles directly on the price chart. It uses the security function to fetch the low value from a Heikin Ashi ticker for the chart's active timefr

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

This strategy plots modified Bollinger Bands and an exponential moving average on the price chart. It watches for closes crossing the upper or lower band, optionally filtered by the EMA trend and extra crossover or crossunder checks. Long stops use the recent

Strategy v5 Volatility & bandsMoving averages
Updated 2 years ago · GPL-3.0 GitHub repository of Bollinger Bands Modified (Stormer)

Example 6

by be-thomas
65 stars

This overlay indicator requests the low of a Heikin Ashi series built from the symbol’s regular session and plots that value on the price chart. It builds a regular-session ticker, converts it with heikinashi, then reads the low through security on the chart’s

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

Example 6.1

by be-thomas
65 stars

This indicator retrieves Heikin Ashi candle data for the current symbol and timeframe using the security function. It constructs and plots custom Heikin Ashi candlesticks, coloring them green when the Heikin Ashi close is greater than or equal to the Heikin As

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

Morning Doji Star - Bull

by TWODS-CAPITAL
37 stars

The Morning Doji Star Bullish indicator identifies a three-candle bullish reversal pattern consisting of a long black candle, a gapping doji, and a long white candle closing above the midpoint of the first body. It applies optional trend filtering using SMA50

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

[RS]MTF Candle Sticks

by ricardosantos79
261 stars

This indicator overlays up to five higher-timeframe candlestick groups on the price chart. For each enabled timeframe it requests open, high, low, and close and can show up to five candles, offset by a spacing setting. The main inputs set the candle count, the

Indicator v4 Candlestick patternsSupport & resistance Repaints
Updated 4 years ago · None stated GitHub repository of [RS]MTF Candle Sticks

Morning Star - Bullish

by TWODS-CAPITAL
37 stars

Morning Star - Bullish is a price chart indicator that automatically identifies three-candle bullish Morning Star candlestick patterns. It filters pattern occurrences using optional trend context defined by 50-period or 200-period simple moving averages. When

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

Volume Candle Coloring

by eddiebelaval
7 stars

This indicator colors price chart candles according to trading volume relative to a simple moving average. It classifies volume into five distinct tiers ranging from low to ultra using customizable multiplier thresholds. Candles are painted directly on the mai

Indicator v6 VolumeCandlestick patterns
Updated 3 months ago · None stated GitHub repository of Volume Candle Coloring
2 stars

This indicator simulates and backtests candlestick pattern performance directly on the price chart. Utilizing an imported pattern recognition library, it calculates theoretical trade outcomes based on user-defined entry modes, stop-loss methods (ATR or pattern

Indicator v5 Candlestick patternsScreeners & dashboards
Updated 8 months ago · None stated GitHub repository of Candlestick Patterns on Backtest

Breakeven Line Demo

by hasnocool
106 stars

The Breakeven Line Demo strategy is a Pine Script demonstration tool designed to visualize the average position price of stacked trades. It enters long positions after seven consecutive bearish candles and short positions after seven consecutive bullish candle

Strategy v5 Mean reversionSupport & resistance
Updated 2 years ago · GPL-3.0 GitHub repository of Breakeven Line Demo
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns. An algorithm mode setting switches between looser and strict engulfing definitions, and a threshold separates big from small candles. Other settings set the maximum number of engu

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

Institutional CRT Engine

by alboogycOdR
6 stars

Calculates Candle Range Theory (CRT) ranges using specific one-hour or four-hour New York session candles. The indicator draws CRT range boxes directly on the price chart and plots entry signals based on Market Structure Shifts (MSS) with Fair Value Gaps (FVG)

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of Institutional CRT Engine

Inside Extended

by g-moe
3 stars

Inside Extended tracks inside bar patterns and projects their initial breakout ranges on the price chart. When a candle body falls completely within the high-low range of the prior candle, the indicator marks the inside bar in yellow and establishes the mother

Indicator v5 Candlestick patternsBreakout
Updated 5 months ago · None stated GitHub repository of Inside Extended
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns. Algorithm modes range from looser to strict engulfing, with a threshold separating big from small candles. Settings limit how many zones and how much history are kept, with a sepa

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

Delta Volume Candles [LucF] plots replacement candles on the price chart and colors them from delta volume derived with lower-timeframe intrabar data. Users choose body coloring, including polarity or several volume-balance modes, optional gradients, and hollo

Indicator v5 VolumeCandlestick patterns
Updated 8 months ago · None stated GitHub repository of Delta Volume Candles [LucF]
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns. Algorithm modes range from looser to strict engulfing, with a threshold separating big from small candles. Settings limit how many zones and how much history are kept, with a sepa

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

This overlay indicator detects tweezer tops and bottoms and kangaroo-tail pin bars, then draws supply and demand zones from those patterns. It scores each zone, decays freshness, merges overlapping zones, and can invalidate a zone after a close-through or afte

Indicator v6 Candlestick patternsSupport & resistance
Updated 2 days ago · MIT GitHub repository of Tweezer & Kangaroo Zones [WavesUnchained]
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns, with a zone invalidated after a set number of level breaches. Algorithm modes range from looser to strict engulfing, and a threshold separates big from small candles. Settings lim

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. A lookback setting decides when a zone is invalidated and a tolerance margin allows small breaches. Algorithm modes range from looser to strict engulfing, with a threshold for big

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

Green Bars Count

by be-thomas
65 stars

This simple documentation indicator calculates and plots the cumulative number of green candlestick bars across the chart. It identifies bars where the closing price is greater than or equal to the opening price, then increments a persistent variable on every

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of Green Bars Count

On Neck - Bearish

by TWODS-CAPITAL
37 stars

This indicator identifies the bearish On Neck candlestick pattern on the price chart. The pattern is a two-bar continuation setup occurring during a downtrend, where a long black (bearish) candle is followed by a small white (bullish) candle that opens below t

Indicator v5 Candlestick patterns
Updated 3 years ago · MIT GitHub repository of On Neck - Bearish
1 stars

Draws supply and demand zones on the price chart from engulfing candle patterns, in a version labelled stable by its file name. A lookback setting decides when a zone is invalidated and a tolerance margin allows small breaches. Algorithm modes range from loose

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

Green Candle Close

by be-thomas
65 stars

This script checks whether the current bar closes higher than it opens, representing a bullish green candle. When a green candle occurs, the indicator assigns and plots the closing price in a separate pane; otherwise, it outputs a null value. Designed as a bas

Indicator v4 Candlestick patterns
Updated 5 days ago · GPL-3.0 GitHub repository of Green Candle Close
6 stars

Institutional CRT Engine v5.0 identifies institutional trading setups using Candle Range Theory (CRT) across user-selected session anchor bars in Asia, London, and New York. It plots session range boxes directly on the price chart and monitors for liquidity sw

Indicator v5 SMC / ICT / price actionSessions & time
Updated 7 months ago · None stated GitHub repository of Institutional CRT Engine v5.0

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