Relative Strength Index (RSI)
Calculates the RSI based on the average gains and losses over a specified period. Returns NaN until enough values have been added to fill the window. Once the window is full, it calculates the RSI using the formula:
RSI = 100 - (100 / (1 + (Average Gain / Average Loss)))
where Average Gain and Average Loss are calculated using the SMA of the gains and losses over the specified period. The N template parameter specifies the size of the window for calculating the average gains and losses.