Use This New Candlestick Pattern in Your Trading
Coding a Golden Candlestick Pattern Scanner in TradingView
Candlestick patterns are a great addition to market analysis. Some may even consider them vital in research and trading. This article presents the Golden pattern and shows how to code a scanner in TradingView that detects it.
The Golden 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 Golden pattern is a three-candlestick configuration based on the golden ratio from the Fibonacci sequence. The golden ratio is 1.618 and variations of it include 0.618, 2.618, and 3.618. In this pattern, we are interested in 2.618 which seems to capture better reactions.
The bullish Golden pattern is composed of a normal bullish candlestick with any type of body, followed by a bigger bullish candlestick with a close price that is at least 2.618 times the size of the first candlestick (high to low). Finally, there must be an important condition that is a third candlestick that comes back to test the open of the second candlestick from where the entry is given. The following Figure shows a theoretical illustration of a bullish Golden pattern.
The bearish Golden pattern is composed of a normal bearish candlestick with any type of body, followed by a bigger bearish candlestick with a close price that is at least 2.618 times the size of the first candlestick (high to low). Finally, there must be an important condition that is a third candlestick that comes back to test the open of the second candlestick from where the entry is given. The following Figure shows a theoretical illustration of a bearish Golden pattern.
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 Golden patterns using the following indications:
A black arrow for bullish Golden pattern signals.
A black arrow for bearish Golden pattern 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("Golden Candlestick Pattern", overlay = true)
golden_difference = 2.618 * (high[2] - low[2])
bullish_pattern = low <= open[1] and close[1] > (golden_difference + low[2]) and close[2] > open[2]
bearish_pattern = high >= open[1] and close[1] < (high[2] - golden_difference) and close[2] < open[2]
plotshape(bullish_pattern, style = shape.triangleup, color = color.black, location = location.belowbar, size = size.small)
plotshape(bearish_pattern, style = shape.triangledown, color = color.black, location = location.abovebar, size = size.small)
The following Figure shows a signal chart after the code has been applied and executed. Note that the blue line is the entry level of the pattern.
The following Figure shows another signal chart of a bearish Golden pattern.
The following Figure shows another signal chart where things have gone wrong. Notice how the entry level has been surpassed with strong volatility. Now, this is likely due to a fundamental event such as an economic release or a political statement, but this should not hide the fact that patterns fail from time to time (quite occasionally really).
The following Figure shows another signal chart with multiple levels. Notice how the Golden pattern is mostly a trend following configuration with sometimes being a contrarian pattern.
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!