The Hexad Pattern Recognition in TradingView

Coding a Hexad Candlestick Pattern Scanner in TradingView

Sofien Kaabar, CFA
4 min readJun 2, 2023


Candlestick patterns are a great addition to market analysis. Some may even consider them vital in research and trading. This article presents the Hexad pattern and shows how to code a scanner in TradingView that detects it.

For the complete collection of candlestick patterns in detail with back-tests and technical strategies, you can check out my newest book with O’Reilly Media. The book features a huge number of classic and modern candlestick patterns as it dwelves into the realm of technical analysis with different trading strategies. The book comes with its own GitHub and is dynamic in nature as it is continuously updated and questions are answered on the O’Reilly platform promptly.

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.