Triangular RSI: A Deep Dive into Technical Analysis Techniques
Written on
Chapter 1: Introduction to Triangular RSI
In the realm of technical analysis, structured indicators serve as transformations of existing indicators. For instance, a moving average can be applied to the stochastic oscillator. This article delves into the triangular RSI, a unique variant of the Relative Strength Index (RSI).
I've recently published a book titled "Contrarian Trading Strategies in Python," which includes advanced contrarian indicators and strategies, along with a dedicated GitHub page for code updates. If you're interested, you can purchase the PDF version for 9.99 EUR via PayPal. Kindly include your email in the payment note to ensure it reaches you correctly. Once you receive it, please download it from Google Drive.
Section 1.1: Understanding the Relative Strength Index
The Relative Strength Index, introduced by J. Welles Wilder Jr., stands out as one of the most widely used and adaptable technical indicators. It primarily functions as a contrarian indicator, where extreme values signal potential market reactions that can be capitalized on. The standard procedure for calculating the RSI involves the following steps:
- Compute the change in closing prices compared to the previous ones.
- Differentiate between positive and negative net changes.
- Calculate a smoothed moving average for both positive net changes and the absolute values of negative net changes.
- Determine the Relative Strength (RS) by dividing the smoothed positive changes by the smoothed negative changes.
- Normalize this value using the formula to obtain the RSI.
The chart below illustrates the hourly GBPUSD values in black, accompanied by the 13-period RSI in the second panel.
The RSI typically fluctuates around 25 and tends to stabilize near 75.
Section 1.2: Coding the RSI in Python
To implement the RSI in Python, an OHLC (Open, High, Low, Close) data array is necessary. Below are functions to assist with managing data arrays, calculating moving averages, and ultimately computing the RSI.
def add_column(data, times):
for i in range(1, times + 1):
new = np.zeros((len(data), 1), dtype=float)
data = np.append(data, new, axis=1)
return data
def delete_column(data, index, times):
for i in range(1, times + 1):
data = np.delete(data, index, axis=1)return data
# Additional functions for moving averages and RSI calculations...
Make sure to focus on the concepts rather than the code itself. Most coding implementations of my strategies can be found in my books.
Chapter 2: The Triangular Concept
The triangular moving average, a lesser-known indicator, offers a method of super-smoothing by applying a moving average to another moving average. Let's explore how to apply this concept to the RSI.
To derive the triangular RSI, follow these steps:
- Compute a 5-period RSI based on market price (First RSI).
- Calculate a 5-period RSI on the first RSI (RSIĀ²).
- Finally, compute a 5-period RSI on the second RSI to obtain the Triangular RSI.
The resulting plot, when applied to EURUSD hourly data, is displayed below.
This chart illustrates the three RSI types: the initial RSI based on market price, the second RSIĀ² applied to the first, and the final triangular RSI applied to the second RSI.
Video Description: This video provides an in-depth explanation of the Ascending Triangle stock chart pattern, focusing on technical analysis strategies.
Video Description: Explore how the Relative Strength Index (RSI) can serve as a go-to technical indicator in your trading toolkit.
Chapter 3: Conclusion
In summary, my aim is to contribute to the field of objective technical analysis by promoting transparent techniques and strategies that necessitate thorough back-testing before implementation. This approach seeks to dispel the misconceptions surrounding technical analysis as being subjective and lacking scientific foundation.
When evaluating any trading technique or strategy, consider these essential steps:
- Maintain a critical mindset and eliminate emotional biases.
- Back-test using real-life scenarios and conditions.
- If potential is identified, optimize and conduct forward testing.
- Always account for transaction costs and slippage in your tests.
- Incorporate risk management and position sizing into your evaluations.
Even after ensuring these steps, remain vigilant and monitor the strategy, as market dynamics can shift, rendering previous strategies unprofitable.