By making use of the market`s behavior in the past, we can estimate potential outcomes in the future. What about an easy and comfortable way to automatically highlight specific patterns on a chart and being able to step through them one by one? Also, how about printing the results in an output window? The following article describes how to code the RSI Stepper for Tradesignal.
Example: Oversold RSI vs. Future Performance
Let`s say we would like to analyse oversold conditions of a given market based on the RSI indicator. Also, we want to identify the performance n months afterwards – on a case by case basis. Let us take a look at the Equilla code, which I created for this task:
The first thing to do is declaring the indicator we want to use. For this example I decided to go with the RSI. This is done in line 16, while the period and threshold level are defined as inputs in line 5 and 6. I`d like to test what happens when the underlying market enters an oversold condition. So, we want to measure the performance after the RSI crossed below a specific level (line 25). In line 26 we also use a counter which tells us how many signals have been generated. This way, we can easily analyse each single oversold situation by changing the input called RSI_Events (line 8) – or as I call it: stepping through the signals. The rest of the code is simple: lines 30-35 serve to draw flags on our chart. In order to keep the code simple, I am using weekly data here. Therefore, in the performance calculation section (lines 18-21) the term [-4] equals the henceforth 1 month performance (4 weeks), while [-13] equals the following 3 months performance and so on.
The RSI Stepper in Practice
After having discussed the code, let us now take a look at a practical example. On the chart below, you can see the Carbon future Dec 2019 weekly chart with one oversold signal highlighted in yellow. The dots represent points in time 1, 3, 6 and 12 months later.
Additionaly, if you open up the output window, the corresponding data (signal date, RSI value and future performance figures) is shown for each RSI signal. By increasing or decreasing the input value of the parameter RSI_Events, you can now jump back and forth and see the data. A comfortable way to analyse historic events, isn`t it?
Tradesignal® is a registered trademark of Tradesignal GmbH. Unauthorized use or misuse is strictly prohibited. Data by Refinitiv Eikon.