ICE Data Services -

AGet.rsi() Advanced GET Studies


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).



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


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:
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.



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);

See Also

Advanced GET Study Functions