Please Develop Function for RMA (Running Moving Average) for ReactiveStateEngine

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

Modified 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}}}{\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 =1/N} {\displaystyle \alpha }\alpha  {\displaystyle N}N {\displaystyle \alpha =2/(N+1)}{\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.

请先 登录 后评论

最佳答案 2022-04-01 13:04

hello, have you tried gema function? https://www.dolphindb.cn/cn/help/FunctionsandCommands/FunctionReferences/g/gema.html?highlight=gema

请先 登录 后评论

其它 0 个回答

  • 1 关注
  • 0 收藏,1163 浏览
  • Vishvesh Upadhyay 提出于 2022-03-27 15:43

相似问题