Technical analysis Chart analysis Technical indicators

Price Divergence and RSI. Checking the Robustness in Signal Detection

Елена Берсенева 10 December 2021 699 4 Price Divergence and RSI. Checking the Robustness in Signal Detection

There are many ways to determine a reversal in quotes flow of financial instruments. Among them, the most effective method is divergence. Divergence occurs when the price moves in the direction opposite to the technical indicator in the stock market. If a financial instrument shows new peaks or troughs on the chart and the indicator does not draw similar peaks, so it certainly implies a discrepancy between the price and the indicator readings. The resulting discrepancy is usually considered to be a reversal signal.


In our study, we take one of the most popular oscillators, the RSI indicator. The RSI can track the quotes fluctuations and set its own minimum and maximum scales.

Hypothesis
To conclusion

The price divergence and the RSI indicator signal a reversal (or correction) of the price movement.

To conclusion

Now let's talk about the indicator itself.


The RSI indicator was first introduced in 1978 by its author J. Wallace Wilder in Commodities magazine, and then was described in detail in the book titled "New Concepts in Technical Trading Systems"


This indicator refers to the oscillators class. Its main purpose is to determine the relative strength of the trend.


The author recommends using the RSI indicator with a default period of 14. We consider this period in our study.


As we already know, the RSI is a divergence indicator in the stock market.


In our study, we analyze the discrepancy between the price and the RSI indicator (with the period of 14) as a trading signal. We use a bullish divergence as a buy signal and a bearish divergence as a sell signal (Fig. 1, 2):

Price Divergence and RSI. Checking the Robustness in Signal Detection - Photo 1Price Divergence and RSI. Checking the Robustness in Signal Detection - Photo 2

We test the suggested divergences on a large volume of historic financial instrument data and on two timeframes.


Now let's discuss the conditions for opening and closing a trading position.


Opening a position:

After the signal is formed, a position is opened at the opening of a new candlestick:

  • Bullish divergence is a buy signal;
  • Bearish divergence is a sell signal.


Closing a position:

In all conditions, the position lifetime is set to 5 or 10 (in candlesticks).

Data used

Next, we determine the set of financial instruments and their timeframes which we test the trading signal on. This sample will be presented by:

  • 23 currency pairs (Forex);
  • 6 commodity futures (Commodities);
  • 2 stock indices (Indices);
  • 30 shares included in Dow30 (Shares).


Used Timeframes:

  • H1 (1 hour) – 5 years of quote history;
  • D1 (1 day) – 10 years of quote history.


The sample consists of 2,101,235 values.

Having defined all the conditions and set the necessary parameters, let's go down to testing!



Analysis of the results


Firstly, we estimate the results by the sample size:


For the 1-hour timeframe (H1):


Type of financial instruments
Number of candlesticks
Number of events
Forex
994755
39755
Commodities
172240
7031
Indices
87600
3493
Stocks
628011
24726



For a day-timeframe:

Type of financial instruments
Number of candlesticks
Number of events
Forex
83950
3278
Commodities
18250
752
Indices
7300
352
Stocks
109129
4683


Total: 2,101,235 candlesticks and 84,070 events (Divergences).



Next what we analyze is the share of events in the total number of initial candlesticks aggregating data from two timeframes:


Type of financial instruments
The share of events in the total number of candlesticks, %
Forex
3.99
Commodities
4.09
Indices
4.05
Stocks
3.99
Average
4.03



The results refering to the share aggregation have shown that the distribution of events is roughly the same, namely from 3.99 to 4.09% regardless of the types of financial instruments.



Next, we consider the results of handled trading signals received from formed divergences.


We evaluate the results according to two criteria:


  • Momentum (m) – reflects the average increment rate of financial quotes when fixing positions, in %. The positive momentum value indicates the profitability of handled signal, a negative one indicates the loss.
  • SPP – the share of profitable positions, %.


Momentum in % and the share of profitable positions in % in terms of holding positions, timeframes and types of financial instruments:


Indicator
5 candlestick
10 candlestick
Н1
D1
Forex
Commodities
Indices
Stocks
m
-0.003
-0.057
-0.023
-0.037
0.028
-0.064
-0.034
-0.068
SPP
49.6
49.3
49.5
49.4
50.4
50.1
46.4
48.7


7 out of 8 average momentum values are negative on the parameters.


Plus, some peculiarities can be outlined.


To do this, we can visualize the results in the form of momentum distribution (m) over each parameter (position closing candlestick, timeframe, type of financial instruments):

Price Divergence and RSI. Checking the Robustness in Signal Detection - Photo 3

The chart above illustrates the distribution of momentum depending on the parameters. The chart consists of two parts: a "box" and "tails" or "whiskers". 50% of the observed values are placed within the box, the remaining 50 are represented with tails. The end of the lower tail shows the smallest of the observed values, the end of the upper tail is the largest one. The cross shows the average value.


The analysis of the results allows us to make the following preliminary conclusions:


  • The average momentum value when fixing positions on the 5th candlestick is higher than the average value of the fixation on the 10th candlestick, which indicates a lower loss-making closing positions on the 5th candlestick (the momentum values are negative);
  • The average momentum value on the hourly timeframe is higher than on the daily one, which indicates that the signal is less unprofitable on the hourly charts (the momentum values are negative);
  • The best momentum (in comparison with others) is noted on the financial instrument currency pairs (0.028%).


Let’s review the results in terms of holding positions, timeframes, and types of financial instruments.


Take the notation keys:

«H1 / 5» – fixing the position on the 5th candlestick when working on the 1 hour timeframe;

«H1 / 10» – fixing a position on the 10th candlestick when working on the 1 hour timeframe;

«D1 / 5» – fixing a position on the 5th candlestick when working on the 1 day timeframe;

«D1 / 10» – fixing a position on the 10th candlestick when working on the 1 day timeframe;

SPP – the share of profitable positions, %.


Н1/5
Indicator
Stocks
Indices
Commodities
Forex
All
Number of signals
24726
3493
7031
39755
75005
Momentum
-0.0267
-0.0035
0.017
0.0002
-0.0033
SPP
49
49
49.9
50.1
49.5
Н1/10
Indicator
Stocks
Indices
Commodities
Forex
All
Number of signals
24719
3492
7029
39746
74986
Momentum
-0.0771
-0.003
0.0264
0.0041
-0.0124
SPP
48.8
48.5
51
50.4
49.6
D1/5
Indicator
Stocks
Indices
Commodities
Forex
All
Number of signals
4683
352
752
3278
9065
Momentum
-0.0294
0.0535
-0.054
0.0588
0.0072
SPP
48.9
47.2
50.3
50.9
49.7
D1/10
Indicator
Stocks
Indices
Commodities
Forex
All
Number of signals
4672
352
752
3273
9049
Momentum
-0.1406
-0.183
-0.2454
0.0472
-0.1305
SPP
48.3
41.2
49.3
50.5
49.0



Summing up the results using the charts:

Price Divergence and RSI. Checking the Robustness in Signal Detection - Photo 4Price Divergence and RSI. Checking the Robustness in Signal Detection - Photo 5

The best momentum of 0.0072% is seen with signals on the 1 day timeframe when fixing a position on the 5th candlestick (signals on currency pairs are more profitable).


But the momentum is small, hence, the signal is ineffective.

Conclusion

In general, trading signals are ineffective if they are formed at price divergence and RSI with a 14th period.


There is no impact of the price divergence and RSI on the market.

Detailed results are given in the application:

XLSX (0.08 MB)Application to the article 'Divergence of price and RSI. Let's check the reliability of the signal..'.xlsx

Comments

4

Write the comment

Commenting rules
Only authorized users can leave comments. Sign in, please.
Only users with verified email can leave comments. To verify your email, click on the link in the message that has been sent to your email address . Send an email for activation again.