RSI (Function)

image\trumpet2.gif Disclaimer

The RSI (Relative Strength Index)   series function returns a value between zero and one hundred, regardless of the asset it is applied to. It is easy to calculate and keep track of. After calculating the initial RSI, only the previous day’s data is required for the next calculation.

Syntax

RSI(Price, Length)

Returns

A numeric value containing RSI for the current bar.

Parameters

Name

Type

Description

Price

Numeric

Specifies which bar value (price, function, or formula) to be considered.

Length

Numeric

Sets the number of bars to consider.

Remarks

The equation for the Relative Strength Index, RSI is:

RSI = 100 - (100/(1+RS))

RS = Average of 14 day’s closes UP / Average of 14 day’s closes DOWN

To calculate the first RSI value

    1. Calculate the sum of the UP closes for the previous 14 days and divide this sum by 14. This is the average UP Close.

    2. Calculate the sum of the DOWN closes for the previous 14 days and divide by 14.
      This is the average DOWN Close.

    3. Divide the average UP Close by the average DOWN Close. This is the Relative Strength (RS).

    4. Add 1.00 to the RS.

    5. Divide the result obtained in Step 4 into 100.

    6. Subtract the result obtained in Step 5 from 100. This is the first RSI.

To calculate the RSI each time following the first RSI value

    1. To obtain the next average UP Close: Multiply the previous average Up Close by 13, add to this amount today’s UP Close ( if any ) and divide the total by 14.

    2. To obtain the next average DOWN: Multiply the previous average DOWN Close by 13, add to this amount today’s DOWN Close (if any) and divide the total by 14.

    3. Steps (3), (4), (5) and (6) are the same as for the initial RSI.

The input Price is usually hard coded with some bar attribute such as Close, Open, High, Low, and Volume or is replaced with a numeric series type input. However, it can be replaced with a valid EasyLanguage expression. For example: Close + Open, or Average(RSI(Close,14),14).

The input Length, just like Price, can be hard coded or replaced with a numeric simple type input.

Example

Plot1(RSI(Close,14));

Reference

Wilder, J. Welles, Jr. New Concepts in Technical Trading Systems (Greensboro, NC: Trend Research, 1978).