RMA
Syntax Format
rma(series, period)
Overview
RMA
(Rolling moving average) belongs to the MA family, and is similar to the Smoothed Simple Moving Average (SSMA
), smoothing the price movement to better spot significant trends and reduce the noise along the way. The difference between those Moving Averages is that RMA
due to the calculation can be considered as more consistent and responsive.
Parameters
Parameter | Type | Purpose |
---|---|---|
source | series | Input series, taken into calculation |
period | integer | Moving Average period |
Returns: series
.
Example
instrument { name = "Rolling Moving Average (RMA)", overlay = true }
period = input (14, "Period", input.integer, 1, 100)
src = input (close, "Source")
rma = 0
if not rma[1] then
rma = src
else
rma = (rma[1] * (period - 1) + src) / period
end
plot(rma, "RMA", color.blue, 2)
Formula
The formula for calculating RMA
is:
The previous value of the RMA
is added to the current price value and divided by the chosen period. The calculation is moderately similar to the one of EMA
, but gives a smoother result.