Skip to content
Algo Trade Analytics Docs

ta.rma() - Pine Script Function

Moving average used in RSI. It is the exponentially weighted moving average with alpha = 1 / length.

ta.rma(source, length) → series float
NameTypeDescription
sourceseries int/floatSeries of values to process.

Exponential moving average of source with alpha = 1 / length.

  • na values in the source series are ignored; the function calculates on the length quantity of non-na values.
//@version=6
indicator("ta.rma")
plot(ta.rma(close, 15))//the same on pinepine_rma(src, length) => alpha = 1/length sum = 0.0 sum := na(sum[1]) ? ta.sma(src, length) : alpha * src + (1 - alpha) * nz(sum[1])
plot(pine_rma(close, 15))