From 5cee63f74afd3b99021b93723c3713a47667504b Mon Sep 17 00:00:00 2001 From: Supreet Sethi Date: Wed, 17 Jul 2024 12:22:51 +0800 Subject: [PATCH 1/7] using convention if .iloc instead of direct index seek using convention if .iloc instead of direct index seek --- ta/trend.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ta/trend.py b/ta/trend.py index 553afad..8cd8623 100644 --- a/ta/trend.py +++ b/ta/trend.py @@ -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 From cbe86ac525b0425e36725f37fb151c5165787d00 Mon Sep 17 00:00:00 2001 From: Supreet Sethi Date: Wed, 17 Jul 2024 12:28:09 +0800 Subject: [PATCH 2/7] updated numpy stable --- requirements-core.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-core.txt b/requirements-core.txt index 5cb8fcd..530005e 100644 --- a/requirements-core.txt +++ b/requirements-core.txt @@ -1,2 +1,2 @@ -numpy==1.21.5 +numpy==1.19.5 pandas==1.3.5 From dee27a6bfd05822b087fee75d4cee8dadf8bde66 Mon Sep 17 00:00:00 2001 From: Supreet Sethi Date: Wed, 17 Jul 2024 12:29:04 +0800 Subject: [PATCH 3/7] pandas stable --- requirements-core.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-core.txt b/requirements-core.txt index 530005e..3dc3bed 100644 --- a/requirements-core.txt +++ b/requirements-core.txt @@ -1,2 +1,2 @@ numpy==1.19.5 -pandas==1.3.5 +pandas==1.1.5 From 3d12796e6444b011e77513ed3d4a61bda072bbd3 Mon Sep 17 00:00:00 2001 From: Supreet Sethi Date: Wed, 17 Jul 2024 12:30:48 +0800 Subject: [PATCH 4/7] Update requirements-test.txt --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index 36faeda..c624cac 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -1,5 +1,5 @@ -r requirements-core.txt # clean code -black==23.10.1 +black==22.8.0 prospector[with_mypy,with_bandit]==1.10.3 From cbd7789df520e20d13ffe1c66d171ec365360a62 Mon Sep 17 00:00:00 2001 From: Supreet Sethi Date: Wed, 17 Jul 2024 12:32:26 +0800 Subject: [PATCH 5/7] Update requirements-test.txt --- requirements-test.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements-test.txt b/requirements-test.txt index c624cac..683beb4 100644 --- a/requirements-test.txt +++ b/requirements-test.txt @@ -2,4 +2,4 @@ # clean code black==22.8.0 -prospector[with_mypy,with_bandit]==1.10.3 +prospector[with_mypy,with_bandit]==1.7.7 From e57d0c989bceee91215f77e9289ce20256e46dc0 Mon Sep 17 00:00:00 2001 From: Supreet Sethi Date: Wed, 17 Jul 2024 12:40:16 +0800 Subject: [PATCH 6/7] Update trend.py for whitespace issues --- ta/trend.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/ta/trend.py b/ta/trend.py index 8cd8623..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] = ( From bcfebd1054eb91a2f8219cb8eed275f1dc5b7ea7 Mon Sep 17 00:00:00 2001 From: Supreet Sethi Date: Wed, 17 Jul 2024 12:40:54 +0800 Subject: [PATCH 7/7] Update volatility.py for white space issues --- ta/volatility.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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