MetaStock Relative Strength Index Function

Provided By

The Relative Strength Index (RSI) is a very popular oscillator and is widely used. The RSI measures the internal strength of a security rather than measuring the strength of a security relative to something else as the name would suggest. It actually compares the magnitude of a security's recent gains with the magnitude of its recent losses. It is commonly used to spot weaknesses in existing trends and can provide early warning of a trend change.


The formula for the RSI is

In the above formula:

U = An average of upward price change

D = An average of downward price change

The RSI ranges between 0 and 100 with 70 and 30 commonly used as overbought/oversold levels.

SYNTAX RSI(Data Array, Periods)

Data Array _ This data array is used to determine the relative strength.

Periods _ This specifies how many periods are used to determine the average upward and downward moves.

Note: `RSI(Periods)' can also be used, as Metastock will select the closing price data array as the default


Here is an example using the RSI:


In the above example:

Data Array = C

Periods = 14 


A more useful application of this example could be:


This formula specifies that the RSI must be above 30 which is used as a common reference line, along with 70. A basic strategy with the RSI is to go long when the RSI crosses above 30 and to go short when it crosses below 70.

Looking at Figure 3.31, we can see the RSI indicator at the base of the chart.


Figure 3.31 _ RSI Indicator   


Construct formulas for the following:

1. The RSI (using 15 periods) crosses the 30 reference line:


2. The RSI (using 15 periods) has increased over the last 3 periods:


This article is a snippet from the
MetaStock Programming Study Guide...

"Discover The Simple Secret to Make Metastock Easy & Identify Profitable Trades"

Click Here To Find For More About
The MetaStock Programming Study Guide

copyright 2007