TA-Lib / ta-lib

TA-Lib (Core C Library)
https://ta-lib.org/
BSD 3-Clause "New" or "Revised" License
602 stars 152 forks source link

Please add the RMA indicator to the library #41

Open DelphiMan68 opened 1 month ago

DelphiMan68 commented 1 month ago

Hello, 🌺 These days, in many strategies, the RMA indicator is used. The structure of this indicator is very similar to EMA and it is better to be placed in the library to make it easier to use this common indicator.

In the pinescript language, you can understand the difference between EMA and RMA by checking the following codes:

1) EMA :

pine_ema(src, length) =>
    alpha = 2 / (length + 1)
    sum = 0.0
    sum := na(sum[1]) ? sma(src, length) : alpha * src + (1 - alpha) * nz(sum[1])

2) RMA :

pine_rma(src, length) =>
    alpha = 1/length
    sum = 0.0
    sum := na(sum[1]) ? sma(src, length) : alpha * src + (1 - alpha) * nz(sum[1])

Thank you for your attention 🙏