Beyond the Basics: Exploring a New Candlestick Pattern for Investors
Coding a Hexad Candlestick Pattern Scanner in TradingView
Candlestick patterns deserve to be studied thoroughly and even though a strategy relying solely on them will be unstable and unprofitable, they can be a valuable addition into a full trading system that uses other techniques. In this article, you will see a full presentation and code of a six-candle reversal pattern.
The Hexad 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 Hexad pattern is a six-candlestick contrarian configuration. The general shape is a few stabilizing candles.
The bullish Hexad is composed of three bullish candlesticks that follow three bearish candlesticks with the last candlestick having a close higher than the high of the first candlestick. The following Figure shows a theoretical illustration of the bullish Hexad.
The bearish Hexad is composed of three bearish candlesticks that follow three bullish candlesticks with the last candlestick having a close lower than the low of the first candlestick. The following Figure shows a theoretical illustration of the bearish Hexad.
You can also check out my other newsletter The Weekly Market Sentiment Report that sends tactical directional views every weekend to highlight the important trading opportunities using a mix between sentiment analysis (COT reports, Put-Call ratio, Gamma exposure index, etc.) and technical analysis.
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 Hexad patterns using the following indications:
A green arrow for bullish Hexad signals.
A red arrow for bearish Hexad 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("Candlestick Pattern - Hexad", overlay = true)
bullish_hexad = close > open and close[1] > open[1] and close[2] > open[2] and close[3] < open[3] and close[4] < open[4] and close[5] < open[5] and close > high[5]
bearish_hexad = close < open and close[1] < open[1] and close[2] < open[2] and close[3] > open[3] and close[4] > open[4] and close[5] > open[5] and close < low[5]
plotshape(bullish_hexad, style = shape.triangleup, color = color.green, location = location.belowbar, size = size.small)
plotshape(bearish_hexad, 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.
The following Figure shows another signal chart.
You can also check out my other newsletter The Weekly Market Analysis Report that sends tactical directional views every weekend to highlight the important trading opportunities using technical analysis that stem from modern indicators. The newsletter is free.
If you liked this article, do not hesitate to like and comment, to further the discussion!