RSI

All functions · nseries package

RSI

func (s Series) RSI(n int) Series

RSI implements Wilder’s Relative Strength Index using a slightly more efficient algorithm than Wilder used.

The output is on a 0 to 100 scale. The warm-up reads 0, not NaN: bars 0 to n-1 are exactly 0, the first valid index is n and the minimum length is n + 1. 0 is the oversold extreme, so a < 30 rule fires on every warm-up bar; trim (Window(-n)) or mask (SetN(n, math.NaN())) the warm-up first. A flat window after the warm-up gives 50.

RSIWilderOriginal

func (s Series) RSIWilderOriginal(n int) Series

RSIWilderOriginal calculates the n-period Relative Strength Index (using Wilder’s formula).

The output is on a 0 to 100 scale. The warm-up reads 0, not NaN: bars 0 to n-1 are exactly 0, the first valid index is n and the minimum length is n + 1. 0 is the oversold extreme, so a < 30 rule fires on every warm-up bar; trim (Window(-n)) or mask (SetN(n, math.NaN())) the warm-up first. Unlike RSI, a flat window after the warm-up also gives 0.