Candlestick patterns are a great addition to market analysis. Some may even consider them vital in research and trading. This article presents the H pattern and shows how to code a scanner in TradingView that detects it.
The Fibonacci Trading Book is finally out! Filled with Fibonacci-based trading methods (tools, indicators, patterns, and strategies), this book will guide you through improving your trading and analysis by incorporating an important technical analysis approach that is Fibonacci [PDF Version available, see end of article).
The Fibonacci Trading Book
Amazon.com: The Fibonacci Trading Book: 9798394344046: Kaabar, Sofien: Booksamzn.to
The HÂ Pattern
Candlestick charts are among the most famous ways to analyze the time series visually. They contain more information than a simple line chart and have more visual interpretability than bar charts.
The H pattern is a three-candle configuration that represent a failed Doji pattern and a trend continuation signal.
The bullish H is composed of a bullish candlestick that surpasses the high of the previous Doji with a low that does not break the low of the Doji. At the same time, the candlestick before the Doji must be bullish. The following Figure shows a theoretical illustration of the bullish H.
The bearish H is composed of a bearish candlestick that breaks the low of the previous Doji with a high that does not surpass the high of the Doji. At the same time, the candlestick before the Doji must be bearish. The following Figure shows a theoretical illustration of the bearish H.
Coding the Scanner in TradingView
The conditions of the pattern are relatively easy to code especially in a straightforward and simple coding language such as Pine Script, TradingView’s native language.
The aim of the scanner is to detect the H patterns using the following indications:
A green arrow for bullish H signals.
A red arrow for bearish H signals.
// This source code is subject to the terms of the Mozilla Public License 2.0 at https://mozilla.org/MPL/2.0/
// © Sofien-Kaabar
//@version=5
indicator("H Finder", overlay = true)
bullish_h = close[1] > open[1] and close[1] > high[2] and close[2] == open[2] and close[3] > open[3] and low[1] >= low[2]
bearish_h = close[1] < open[1] and close[1] < low[2] and close[2] == open[2] and close[3] < open[3] and high[1] <= high[2]
plotshape(bullish_h, style = shape.triangleup, color = color.green, location = location.belowbar, size = size.small)
plotshape(bearish_h, style = shape.triangledown, color = color.red, location = location.abovebar, size = size.small)
The following Figure shows a signal chart after the code has been applied and executed. Bear in mind that this pattern is quite rare.
The following Figure shows another signal chart.
The PDF link for the Fibonacci Trading Book is the following (make sure to include your e-mail address in the notes part):
Pay Kaabar using PayPal.Me
Go to paypal.me/sofienkaabar and type in the amount. Since it’s PayPal, it’s easy and secure. Don’t have a PayPal…paypal.me