Strategy · Pine Script v4 · On the chart

Candlestick Patterns Strategy (revisited)

by capissimo

This strategy identifies multiple classic candlestick patterns, including Engulfing, Harami, Morning and Evening Stars, and Three White Soldiers.

View on GitHub

GitHub stars114on the repository
Pine versionv4older, still runs
Lines of code97
Settings18inputs
LicenceNone stated
Last update1 year ago7 Nov 2024

Add It to Your TradingView Chart

  1. 1Copy the scriptPress Copy script above. It reads the file straight from GitHub.
  2. 2Open the Pine EditorOpen a TradingView chart and choose Pine Editor at the bottom of the screen.
  3. 3Paste over the templateCreate a new strategy, select all of the template text and paste. Press Save and give it a name.
  4. 4Add it to the chartPress Add to chart. The trades and results appear in the Strategy Tester tab; adjust the settings with the gear icon.

Source Code

The code stays on GitHub. The author has not published this script under an open licence, so ForexR does not show its code. Copy script reads the file straight from GitHub into your clipboard, so you can still try it on your own chart. Ask the author before reusing the code anywhere else.

Overview

Candlestick Patterns Strategy (revisited) executes trades directly on the price chart when selected bullish or bearish patterns trigger. Users can toggle individual candlestick formations on or off, enable or disable strategy orders, adjust a backtest start date, and configure an optional trailing stop loss via points and offset inputs. A notable limitation is the absence of secondary trend or volume filters, which can lead to false breakouts in choppy markets.

Details

Published by

capissimo on GitHub

Type

Strategy, Pine Script v4

Draws

On the price chart

Category

Candlestick patterns

Markets

Any symbol

Timeframes

Any timeframe

Risk Notes

No repainting, lookahead or stacked entries were found in its code or README. That says nothing about how well it works: test it first.

Settings

The inputs you can change from the gear icon on the chart. Defaults are the author's.

SettingTypeDefaultVariable
EngulfingbooltrueOnEngulfing
HaramibooltrueOnHarami
Piercing Line / Dark Cloud CoverbooltrueOnPiercingLine
Morning Star / Evening Star booltrueOnMorningStar
Belt HoldbooltrueOnBeltHold
Three White Soldiers / Three Black CrowsbooltrueOnThreeWhiteSoldiers
Three Stars in the SouthbooltrueOnThreeStarsInTheSouth
Stick SandwichbooltrueOnStickSandwich
Meeting LinebooltrueOnMeetingLine
KickingbooltrueOnKicking
Ladder BottombooltrueOnLadderBottom
Use Strategy SetupbooltrueuseStrat
Show all 18 settings
SettingTypeDefaultVariable
Use Trailing Stop?booltrueuseStop
Stop Loss Trail Pointsint1slPoints
Stop Loss Trail Offsetint1slOffset
Starting backtest yearint2019yr
Starting backtest monthint8mn
Starting backtest dayint1dy
Third-party code. ForexR did not write, test or endorse this script, and the summary above was generated automatically from its code and README. Indicators describe the past, and a strategy's backtest can look better than live trading, especially when a script repaints. Check it in the Strategy Tester and on a demo account before you rely on it.

Similar Pine Scripts

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]
285 stars

Mean Reversion Strategy is an overlay strategy that identifies pullbacks using a long-term EMA, RSI, and candlestick patterns. It generates long signals when a bullish engulfing candle forms below the EMA while RSI is oversold, and short signals when a bearish

Strategy v4 Mean reversionCandlestick patterns
Updated 3 years ago · None stated GitHub repository of Mean Reversion Strategy

ESU2023-10M - V1

by dearvn
257 stars

ESU2023-10M - V1 is an intraday trend-reversal strategy designed for index futures contracts on the price chart. It calculates a 3-period moving average of candle highs and lows alongside specific three-bar price action patterns to detect short-term swing high

Strategy v5 TrendCandlestick patterns
Updated 6 weeks ago · None stated GitHub repository of ESU2023-10M - V1

STRG One Bar Pursuit

by harryguiacorn
219 stars

The STRG One Bar Pursuit strategy identifies single-bar momentum reversals by monitoring shifts between bullish and bearish candlesticks starting from the year 2024. It enters a long position when a bullish candle follows a bearish candle and enters a short po

Strategy v5 Candlestick patternsMean reversion
Updated 1 year ago · None stated GitHub repository of STRG One Bar Pursuit
218 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
106 stars

This strategy trades the three-candle strike pattern filtered by trend direction and time sessions. It calculates market regime using linear regression and exponential or smoothed moving averages to distinguish between ranging and trending conditions. Risk man

Strategy v5 Candlestick patternsTrend
Updated 2 years ago · GPL-3.0 GitHub repository of 3 Candle Strike Strategy

More strategys

Trade Your Charts With a Regulated Broker

Compare brokers that connect to TradingView, with spreads, minimum deposits and leverage side by side.

Compare brokers