Skip to content

Commit

Permalink
adding rsi tests
Browse files Browse the repository at this point in the history
  • Loading branch information
bukosabino committed Nov 28, 2019
1 parent fda6f23 commit 9142767
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ta/momentum.py
Expand Up @@ -39,7 +39,7 @@ def _run(self):
emaup = up.ewm(alpha=1/self._n, min_periods=0, adjust=False).mean()
emadn = dn.ewm(alpha=1/self._n, min_periods=0, adjust=False).mean()
rs = emaup / emadn
self._rsi = np.where(emadn == 0, 100, 100-(100/(1+rs)))
self._rsi = pd.Series(np.where(emadn == 0, 100, 100-(100/(1+rs))), index=self._close.index)

def rsi(self) -> pd.Series:
"""Relative Strength Index (RSI)
Expand Down

0 comments on commit 9142767

Please sign in to comment.