Conversation
|
Hi @yarimiz , The results are similar, but not exactly the same, right? You can test your code locally: |
|
@bukosabino Hi is not entirely wrong btw. Correctness depends on implementation (sad to say it (ಥ﹏ಥ) ). For example, I have tested smoothing method of pandas_ta (another ta lib) and they smooth thier true ranges like I did in my implementation (and I show they are identical). They call it RMA (and use it by default). @yarimiz did the same but with Ok, you can say "it's another ta lib, I don't care how they perform smoothing". Lets took a look into TradingView implementation, here is their code of built-in ATR indicator (so they even have docs to it): As we can see, they default smoothing method is RMA (though their RMA is freaking strange, I can't get the same values as they do, but their docs declare it as "It is the exponentially weighted moving average with alpha = 1 / length." and code @yarimiz If you want to speed up it a little bit, you shoud write it like that: |
any update on this @yarimiz |




This PR is to replace the for loop used to calculate the average part of Average True Range.
The result of the calculation is exactly the same, but it runs about ~17 faster.
For loops are bad when using pandas.