Hi, please develop a function for RMA (Running Moving Average) for reactive state engine.
It is defined as follows:
1) from wikipedia https://en.wikipedia.org/wiki/Moving_average
A modified moving average (MMA), running moving average (RMA), or smoothed moving average (SMMA) is defined as:
{\displaystyle {\overline {p}}_{MM,{\text{today}}}={\frac {(N-1){\overline {p}}_{MM,{\text{yesterday}} }+p_{\text{today}}}{N}}}
In short, this is an exponential moving average, with . The only difference between EMA and SMMA/RMA/MMA is how is computed from . For EMA the customary choice is {\displaystyle \alpha =1/N} {\displaystyle \alpha } {\displaystyle N} {\displaystyle \alpha =2/(N+1)}
2) Tradingview Pinescript Reference Manual
https://www.tradingview.com/pine-script-reference/v5/#fun_ta{dot}rma
Please reply as soon as possible.