Pattern recognition is a vast field and can have many innovative ideas or unexplored techniques. This article sheds some light on a type of pattern that can be applied in a different way.
Introduction to Candlesticks
Candlestick charts are a widely used form of financial charting that visually represents the price movements of an asset over a specific period of time. These charts provide traders and analysts with valuable insights into the price dynamics of stocks, commodities, currencies, and other financial instruments. Candlestick charts originated in Japan in the 18th century and were used to track the price movements of rice, but they have since become a staple tool in modern technical analysis.
The primary purpose of candlestick charts is to display the open, high, low, and closing prices of an asset for a given time interval, such as a day, week, or month. Each time interval is represented by a single “candlestick,” which consists of a rectangular body and two lines extending from the top and bottom of the body, known as wicks.
Here’s a breakdown of the different components of a candlestick:
Body: The rectangular portion of the candlestick represents the price range between the opening and closing prices of the asset for the given time period. The body is usually filled with color, either green (or white) to indicate a price increase (bullish movement), or red (or black) to indicate a price decrease (bearish movement).
Wicks: The lines extending from the top and bottom of the body are called wicks or shadows. The upper wick extends from the top of the body to the highest price reached during the time period, while the lower wick extends from the bottom of the body to the lowest price reached. Wicks provide additional information about the price range and the market sentiment during the period.
Open and close prices: The top or bottom edge of the body represents the opening price (where the asset started trading) and the closing price (where the asset ended trading) for the time period. If the closing price is higher than the opening price, the body is typically filled with a bullish color (e.g., green). If the closing price is lower, the body is typically filled with a bearish color (e.g., red).
Candlestick patterns, formed by combinations of one or more candlesticks, are crucial for technical analysis. Traders and analysts use these patterns to identify potential trends, reversals, and market sentiment shifts. Some common candlestick patterns include doji, hammer, engulfing, shooting star, and spinning top, among others.
Overall, candlestick charts provide a visual representation of price movements that can help traders make informed decisions about buying, selling, or holding assets. They offer insights into market psychology, such as the battle between bulls and bears, and can be a powerful tool for both short-term and long-term trading strategies.
Introduction to the RSI
The RSI is a popular technical indicator used in financial analysis to measure the magnitude of recent price changes and evaluate the speed and direction of a price trend. Developed by J. Welles Wilder in 1978, the RSI is widely used by traders and analysts to identify overbought and oversold conditions in various financial markets, including stocks, commodities, currencies, and indices.
The RSI is presented as a numerical value that ranges between 0 and 100. It compares the average of recent upward price movements (gains) to the average of recent downward price movements (losses) over a specified period of time. This comparison is then transformed into an oscillator that oscillates between the 0 and 100 range, with certain levels often considered significant:
Overbought zone: Typically, an RSI value above 70 is considered an indication that the asset might be overbought. This means that the price has risen significantly and may be due for a potential reversal or correction.
Oversold zone: Conversely, an RSI value below 30 is often interpreted as the asset being oversold. This suggests that the price has fallen significantly and could potentially see a rebound or upward correction.
Here’s how the RSI is calculated step by step:
Calculate the smoothed average gains and average losses over a specified period. Average Gain = Sum of gains over the specified period / Number of periods. Average Loss = Sum of losses over the specified period / Number of periods
Calculate the relative strength (RS) by dividing the Average Gain by the Average Loss: RS = Average Gain / Average Loss
Calculate the RSI using the following formula: RSI = 100 — (100 / (1 + RS))
The RSI generates signals based on the movement of its value and its position relative to the overbought and oversold levels. Traders often look for the following types of signals:
Divergence: If the RSI and the price movement are moving in opposite directions, it might signal a potential trend reversal.
Overbought and oversold conditions: When the RSI crosses above the overbought threshold (70), it might suggest a potential pullback or reversal. Similarly, when it crosses below the oversold threshold (30), it might indicate a potential upward move.
RSI pattern recognition: Traders can use certain patterns (namely candlesticks) on the RSI. This is the aim of the article.
It’s important to note that while the RSI can be a valuable tool in technical analysis, it should be used in conjunction with other indicators and analysis methods to make well-informed trading decisions.
Additionally, market conditions can sometimes lead to extended periods of overbought or oversold levels, so it’s crucial to consider the broader context when interpreting RSI signals.
The Absolute U-Turn RSI Pattern
The absolute U-turn pattern is a simple re-integration configuration that resembles the extreme duration method presented in earlier articles. It is simply an RSI candlestick that re-integrates normality after five consecutive periods where it was either below the oversold level or above the overbought level.
The first step before detecting the pattern is to create the Candlestick RSI indicator, which is simply four RSI calculations with each on the open, high, low, and close values, thus giving an RSI that can be charted as a candlestick system. The next step is to find the conditions of the pattern on the Candlestick RSI.
The conditions of the pattern are as follows:
A bullish pattern occurs whenever the low-RSI surpasses 23.6 after having been below it for five consecutive time periods.
A bearish pattern occurs whenever the high-RSI breaks 76.4 after having been above it for five consecutive time periods.
The code for the pattern is as follows:
// 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 RSI - The Absolute U-Turn", overlay = true)
lookback = input(defval = 13, title = 'Lookback')
open_price = ta.rsi(open, lookback)
high_price = ta.rsi(high, lookback)
low_price = ta.rsi(low, lookback)
close_price = ta.rsi(close, lookback)
bullish_pattern = low_price > 23.6 and low_price[1] < 23.6 and low_price[2] < 23.6 and low_price[3] < 23.6 and low_price[4] < 23.6 and low_price[5] < 23.6
bearish_pattern = high_price < 76.4 and high_price[1] > 76.4 and high_price[2] > 76.4 and high_price[3] > 76.4 and high_price[4] > 76.4 and high_price[5] > 76.4
plotshape(bullish_pattern, style = shape.triangleup, color = color.green, location = location.belowbar, size = size.small)
plotshape(bearish_pattern, style = shape.triangledown, color = color.red, location = location.abovebar, size = size.small)
The following shows a bullish signal:
The following shows a few bearish signals:
The following shows a few signals generated by the pattern:
The following shows a few signals generated by the pattern:
Pattern recognition is a powerful technique used in trading and technical analysis to identify and interpret recurring patterns in price charts and other market data. These patterns can provide valuable insights into potential price movements, trends, and reversals. Use them wisely and do not think that these pattern guarantee anything.
You can also check out my other newsletter The Weekly Market Sentiment Report that sends weekly directional views every weekend to highlight the important trading opportunities using a mix between sentiment analysis (COT report, put-call ratio, etc.) and rules-based technical analysis.
If you liked this article, do not hesitate to like and comment, to further the discussion!