Relative Strength Index (RSI)
Previous Topic  Next Topic 

Definition

Courtesy of www.stockcharts.com
Courtesy of www.marketscreen.com

Syntax
RSI(int period, int smooth)
RSI(IDataSeries inputData, int period, int smooth)

Returns default value
RSI(int period, int smooth)[int barsAgo]
RSI(IDataSeries inputData, int period, int smooth)[int barsAgo]

Returns avg value
RSI(int period, int smooth).Avg[int barsAgo]
RSI(IDataSeries inputData, int period, int smooth).Avg[int barsAgo]


Return Type
double; Accessing this method via an index value [int barsAgo] returns the indicator value of the referenced bar.


Parameters

period

The number of bars to include in the calculation

smooth

Smoothing period

inputData

Indicator source data (?)


Examples

// Prints the current value of a 20 period RSI using default price type
double value = RSI(20, 3)[0];
Print("The current RSI value is " + value.ToString());

// Prints the current value of a 20 period RSI using high price type
double value = RSI(High, 20, 3)[0];
Print("The current RSI value is " + value.ToString());


Source Code
You can open up the indicator source code via the NinjaScript Editor.