Issue with reults of rma moving average
See original GitHub issueDescribe the bug ta.rma() should behave exactly like ta.ema() - with the only difference being the weighting factor. Implementation of ta.rma() in pandas_ta calculates the starting value differently than the implementation of ta.ema() specifically, the first value in the ta.rma() result should be a SMA() average of the period. If the first value is different, the whole series is different…
To Reproduce
df = pd.DataFrame({'close': [1.0,0,-1,0,2,-3,4,5,-8,7,8,9,10,-5,10,0]})
df["rma"]=df.ta.rma(close=df["close"], length=4)
df["ema"]=df.ta.ema(close=df["close"], length=4)
the first value that is not a NaN should be the same for both rma() and ema() - but it is not…
Issue Analytics
- State:
- Created 2 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
What is EMA? How to Use Exponential Moving Average With ...
An exponential moving average (EMA) is a type of moving average that places a greater weight and significance on the most recent data...
Read more >What Is EMA?- Exponential Moving Average - Fidelity
Exponential Moving Average (EMA) measures trend directions over a period of time. EMA applies more weight to data that is more current and...
Read more >Here's Why The Exponential Moving Average Will Give You ...
Exponential Moving Average (EMA) technical analysis indicator gives more weight to current prices than past prices and reacts quicker to ...
Read more >Exponential Moving Average (EMA)
The Exponential Moving Average (EMA) is a technical indicator used in trading practices that shows how the price of an asset or security...
Read more >Exponential Moving Average | How To Read And Use EMA
EMA reduces the effect of the noise by cutting the time lag of the data. This is because EMA may exclude past prices,...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sounds good. 😊 I did find this discrepancy by getting different data from ATR (average true range) compared to the official example by J. Wilder (the author of both ATR and RMA). Let’s keep the library as it is then, if all other rma-derived indicators are satisfactory for library users. I would not mess with adding another parametric option to make the indicator following the author’s original formula, let’s keep the current simplified version.
Yup, can confirm that you found the data bug in a 42-years old book! 😃 Below is the calc of TR and ATR for the same raw data from the book using my C# lib: