# AGet.rsi()

ICE Data Services -

Returns the series or values of the GET Relative Stength Index study.
The RSI is calculated by finding the percentage of positive closes (the current close is higher than the previous close) to negative closes (the current close is lower than the previous close).

Syntax

AGet.rsi( LengthRSI , LengthAvg , ExponentialAvg , ReturnSeries [, Series | sym() | inv() ][, BarIndex ] )

Parameters

 Parameter: Description: Default: LengthRSI An integer which represents the number of periods to use for calculation of RSI. n/a LengthAvg An integer which represents the number of periods to use for calculation of the Moving Average. n/a ExponentialAvg A boolean value. If this parameter is True the MA is calculated as exponential, if False - as simple. n/a ReturnSeries Allows to choose what series of the GET Relative Stength Index study should be returned. To choose use the following constants: RSI_RSI = 0 RSI_AVG = 1 n/a Series | sym() | inv() [Optional]  Series Object or function of sym() or inv() to determine symbol/interval source for the study. Base sym/int BarIndex [Optional]  Bar index of series to retrieve. n/a

Return Value(s)

Returns a Series Object when nBarIndex is not specified.

Returns a single value when nBarIndex is specified.

Notes

Only available in versions 11.8 or later.

Code Example

Creating Series Example:

```var bInit = false;
var xSer1 = null;
var xSer2 = null;
var xSer3 = null;
function main() {
if (bInit == false) {
xSer1 = getSeries(AGet.rsi(14, 7, false, RSI_RSI));
xSer2 = getSeries(AGet.rsi(14, 7, false, RSI_AVG));
xSer3 = getSeries(AGet.rsi(14, 3, false, RSI_AVG));
bInit = true;
}
return new Array(xSer1, xSer2, xSer3);
}

```