40
Markets Technical Analysis and Algorithmic Trading Chapter 16: Relative Strength Indicator (RSI) Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Embed Size (px)

Citation preview

Page 1: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Markets Technical Analysis

and Algorithmic Trading

Chapter 16: Relative Strength Indicator (RSI)

Saeed EbrahimijamSPRING 2013-2014

Faculty of Business and EconomicsDepartment of Banking and Finance

Doğu Akdeniz Üniversitesi

FINA417

Page 2: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

2

Momentum oscillator concept (review) RSI history What is Relative Strength Index How to calculate RSI Overbought vs. Oversold Failure swing in RSI RSI Interpretation for trading Polarized fractal efficiency Index(PFE)

Contents

Fundamental of Technical Analysis and Algorithmic Trading

Page 3: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

3

Momentum is the rate of the rise or fall in price.

Momentum oscillator concept

Page 4: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

4

Page 5: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

5

The Relative Strength Index (RSI) is a price momentum indicator

By: Welles Wilder published in a 1978 book, New Concepts in Technical Trading Systems

History of RSI

Page 6: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

6

Particularly those who are commodities and futures oriented.

The RSI is frequently confused with relative strength analysis, which compares the performance of two items (e.g., one stock with another or one stock with an overall market index). Don’t make mistake!!!!

It is intended to chart the current and historical strength or weakness of a stock or market based on the closing prices of a recent trading period.

Introduction

Page 7: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

7

RSI is a rate-of-change oscillator. It measures the velocity at which prices are moving. RSI was intentionally designed to address three flaws

often associated with oscillators.

First, at times, oscillators move erratically because of the drop off of old data in their calculation. For example, if one has a 10-day oscillator and 10 days ago the price of the security moved up or down dramatically, the current oscillator reading will be a misleading low or high reading.

A second problem relates to the vertical scale for an oscillator. How high or low should the oscillator be so that it will signal buying or selling opportunities?

The third and final problem is the need to keep massive amounts of data for

oscillator calculations. RSI presents a solution to these problems.

CONCEPTUAL BASIS OF THE RELATIVE STRENGTH INDEX

Page 8: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

8

RSI is calculated as follows:

The RSI ranges from 0% to 100 %. The RSI is presented on a graph above or below the price

chart.

HOW TO CALCULATE THE RELATIVE STRENGTH INDEX

Page 9: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

9

To get the average up value, add the total points gained on up days during the last 14 days and divide by 14.

The average down value is arrived at by adding the total points lost on down days during the last 14 days and dividing by 14.

Divide the average up value by the average down value to calculate the relative strength (RS).

Insert the RS value into the formula and calculate the first day’s RSI value.

Let’s use 14 days as an example.

Page 10: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

10

Simply multiply the previous up and down average values by 13, add the latest day’s gain or loss to the up or down average, and multiply the total by 14.

Insert the new RS value into the RSI formula and recalculate the RSI.

Updating RSI each period is easy.

Page 11: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

11

Page 12: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

12

Wilder suggests the use of 14 days of data in the RSI calculation; however, other technicians have found that other time periods work with success as well.

The greater the number of periods used, the more stable the RSI is, and the fewer signals are generated.

Short-term RSIs tend to produce more signals than longer-term RSIs, including more false signals.

Figure 15-1 compares RSIs of differing lengths—9 and 14 days—for the S&P 500 index. Note the difference in the number of crossings of the 70 and 30 lines.

Number of periods

Page 13: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

13

Page 14: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

14

Shorter or longer timeframes are used for alternately shorter or longer outlooks.

More extreme high and low levels—80 and 20, or 90 and 10—occur less frequently but indicate stronger momentum.

Page 15: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

15

The RSI can be interpreted from the following five perspectives:

1. Extreme readings. 2. Chart patterns. 3. Failure swings. 4. Support and resistance. 5. Divergence.

INTERPRETING THE RELATIVE STRENGTH INDEX

Page 16: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

16

Extreme RSI readings signal the likelihood of major tops or bottoms.

Although the exact levels to use are subject to debate, Wilder recommends using levels of 70 and 30.

- If the RSI rises above 70, a major top in market prices is likely.

- A decline to below 30 suggests a high probability of a major bottom being made.

Extreme RSI readings

Page 17: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

17

An asset is deemed to be overbought once the RSI approaches the 70 level, meaning that it may be getting overvalued and is a good candidate for a pullback.

Likewise, if the RSI approaches 30, it is an indication that the asset may be getting oversold and therefore likely to become undervalued. 

- It’s generally better to buy a market when it’s oversold and sell when it’s overbought

Overbought and oversold conditions

Page 18: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

18

Page 19: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

19

The chart patterns presented in Lessons 3 through 5 are equally applicable to RSI as they are to regular price charts.

Often, chart patterns (such as a triangle or head-and shoulders top or bottom) can be seen in the RSI.

Since the same breakout rules apply to the RSI as to normal price charts, buy and sell points are frequently indicated.

Chart patterns

Page 20: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

20

Failure swings can also be used in interpretation of the RSI.

what a failure swing is? - As illustrated in Figure 15-2, a top failure swing

occurs when the index rises above 70, declines to a lower level (fail point), rises again but fails to reach the 70 level, and then falls below the prior lower level (a fail point). One would sell at that point.

Figure 15-3 illustrates a bottom failure swing. It is simply the opposite of a top failure swing.

Failure swings

Page 21: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

21

Even one step further is the failure swing, a term that Wilder uses to refer to "very strong indications of a market reversal."

Wilder uses failure swings to confirm his buy and sell points, and in the two figures below you can see that failure-swing points clearly do just that.

Failure swing in RSI

Page 22: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

22

Wilder thought that "failure swings" above 70 and below 30 on the RSI are strong indications of market reversals.

The center line for the relative strength index is 50, which is often seen as both the support and resistance line for the indicator:

- If the relative strength index is below 50, it

generally means that the stock's losses are greater than the gains.

- When the relative strength index is above 50, it

generally means that the gains are greater than the losses.

Failure swing in RSI

Page 23: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

23

Page 24: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

24

Page 25: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

25

Support and resistance lines will often be apparent on the RSI before they are apparent on the bar chart of prices.

Breaking of support or resistance is interpreted in a similar fashion to the interpretation of price charts.

Refer to chapter 7 on support and resistance for a refresher.

Support and resistance

Page 26: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

26

Divergence between prices on a bar chart and the RSI strongly suggests that prices will be reversing.

If prices are rising or flat and the RSI is decreasing, look for a turn downward in prices.

If, on the other hand, prices are declining or fl

at and the RSI is increasing, expect prices to turn and move higher.

Divergence

Page 27: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

27

Page 28: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

28

RSI signal sample

Page 29: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

29

Page 30: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

30

RSI signal interpretations for trading

Page 31: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

31

Page 32: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

32

Polarized Fractal Efficiency

Page 33: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

33

Hans Hannula presented his PFE indicator in 1994 issue of Technical Analysis of Stocks & Commodities magazine.

http://www.traders.com/index.php/sac-magazine

This indicator is intended to portray the laws of "fractal geometry" in the form of an oscillator.

It is better to use it on price diagram.

Polarized Fractal Efficiency (PFE)

Page 34: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

34

The formula is very complex. A description of this formula in words might be confusing.

The PFE is calculated of the Exponential Moving Average (EMA) of Effizent:

PFE calculation 1

Page 35: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

35

The Polarized Fractal Efficiency indicator uses fractal geometry to determine how efficiently the price is moving.

http://finmind.blogspot.com/2005/08/william-eckhardt-c-test.html

PFE calculation 2

Page 36: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

36

The adjustable period length can be chosen from 2 to 500. The most common settings will have a period length ranging from 8 to 30.

Use 14 days period of calculation.

Parameters

Page 37: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

37

The more linear and efficient price movement, the shorter the distance the prices must travel between two points. The more "squiggly" the price movement, the less efficient it's travel.

1- The permissible values for PFE lie in the range between +100 and -100. Whilst a crossing of the zero line may be interpreted as a warning of an impending trend change, only values over +40 / +60 are usually regarded as a buy signal and those below -40 / -60 as a sell signal.

2- When the PFE is zigzagging around zero, then the price is congested and not trending. When the PFE is smooth and above/below zero, then the price is in an up/down trend. The higher/lower the PFE value, the stronger the trend is.

PFE Interpretation

http://www.amibroker.com/library/list.php

Page 38: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

38

The strength of the trend is measured by the position of the PFE relative to the zero line. As a general rule, the further the PFE value is away from zero, the stronger and more efficient the given trend is. A PFE value that fluctuates around the zero line could indicate that the supply and demand for the security are in balance and price may trade sideways.

Simple decision making of trading policy: Find maximum and minimum points on PFE diagram: - Max points are appropriate time for Sell. - Min points are appropriate time for Buy.

PFE & trading decision making

Page 39: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

39

PFE signal

Page 40: Saeed Ebrahimijam SPRING 2013-2014 Faculty of Business and Economics Department of Banking and Finance Doğu Akdeniz Üniversitesi FINA417

Fundamental of Technical Analysis and Algorithmic Trading

40

Install a PFE indicator on your Metatrader software and find the PFE index on EURUSD price ratio. Then Interpret your findings.

H.W .