diff --git a/requirements-core.txt b/requirements-core.txt index 5cb8fcd..3dc3bed 100644 --- a/requirements-core.txt +++ b/requirements-core.txt @@ -1,2 +1,2 @@ -numpy==1.21.5 -pandas==1.3.5 +numpy==1.19.5 +pandas==1.1.5 diff --git a/requirements-test.txt b/requirements-test.txt index 36faeda..683beb4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ -r requirements-core.txt # clean code -black==23.10.1 -prospector[with_mypy,with_bandit]==1.10.3 +black==22.8.0 +prospector[with_mypy,with_bandit]==1.7.7 diff --git a/ta/trend.py b/ta/trend.py index 553afad..161c877 100644 --- a/ta/trend.py +++ b/ta/trend.py @@ -728,7 +728,7 @@ def _run(self): self._trs_initial = np.zeros(self._window - 1) self._trs = np.zeros(len(self._close) - (self._window - 1)) - self._trs[0] = diff_directional_movement.dropna().iloc[0 : self._window].sum() + self._trs[0] = diff_directional_movement.dropna().iloc[0:self._window].sum() diff_directional_movement = diff_directional_movement.reset_index(drop=True) for i in range(1, len(self._trs) - 1): @@ -745,7 +745,7 @@ def _run(self): neg = abs(((diff_down > diff_up) & (diff_down > 0)) * diff_down) self._dip = np.zeros(len(self._close) - (self._window - 1)) - self._dip[0] = pos.dropna().iloc[0 : self._window].sum() + self._dip[0] = pos.dropna().iloc[0:self._window].sum() pos = pos.reset_index(drop=True) @@ -757,7 +757,7 @@ def _run(self): ) self._din = np.zeros(len(self._close) - (self._window - 1)) - self._din[0] = neg.dropna().iloc[0 : self._window].sum() + self._din[0] = neg.dropna().iloc[0:self._window].sum() neg = neg.reset_index(drop=True) @@ -804,7 +804,7 @@ def adx(self) -> pd.Series: directional_index[idx] = 0 adx_series = np.zeros(len(self._trs)) - adx_series[self._window] = directional_index[0 : self._window].mean() + adx_series[self._window] = directional_index[0:self._window].mean() for i in range(self._window + 1, len(adx_series)): adx_series[i] = ( @@ -1027,7 +1027,7 @@ def _run(self): # noqa high1 = self._high.iloc[i - 1] high2 = self._high.iloc[i - 2] if high2 > self._psar.iloc[i]: - self._psar[i] = high2 + self._psar.iloc[i] = high2 elif high1 > self._psar.iloc[i]: self._psar.iloc[i] = high1 diff --git a/ta/volatility.py b/ta/volatility.py index 3bbf57e..bf994db 100644 --- a/ta/volatility.py +++ b/ta/volatility.py @@ -47,7 +47,7 @@ def _run(self): close_shift = self._close.shift(1) true_range = self._true_range(self._high, self._low, close_shift) atr = np.zeros(len(self._close)) - atr[self._window - 1] = true_range[0 : self._window].mean() + atr[self._window - 1] = true_range[0:self._window].mean() for i in range(self._window, len(atr)): atr[i] = (atr[i - 1] * (self._window - 1) + true_range.iloc[i]) / float( self._window