ta icon indicating copy to clipboard operation
ta copied to clipboard

Fix division by zero in ADX calculation

Open e271p314 opened this issue 3 years ago • 1 comments

Fix "RuntimeWarning: invalid value encountered in double_scalars" in lines 608 and 612

e271p314 avatar Sep 25 '20 06:09 e271p314

This didnt solve my problem getting NaN as a whole series occasionally. I'm testing a change I made, where every time we do a .shift(1), I set the first element from NaN to 0.0. for example:

trend.py:566 cs = self._close.shift(1) cs[0] = 0.0

and also on dn and up, that seems to have solved my issue.

lord-village avatar Oct 01 '20 12:10 lord-village