Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Commit e65409f

Browse files
committed
performance boost to WMA and IFT_RSI
1 parent cc3385b commit e65409f

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

finta/finta.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -340,7 +340,7 @@ def WMA(cls, ohlc: DataFrame, period: int = 9, column: str = "close") -> Series:
340340
"""
341341

342342
d = (period * (period + 1)) / 2 # denominator
343-
weights = pd.Series(np.arange(1, period + 1))
343+
weights = np.arange(1, period + 1)
344344

345345
def linear(w):
346346
def _compute(x):
@@ -694,7 +694,7 @@ def IFT_RSI(
694694

695695
# v2 = WMA(wma_period) of v1
696696
d = (wma_period * (wma_period + 1)) / 2 # denominator
697-
weights = pd.Series(np.arange(1, wma_period + 1))
697+
weights = np.arange(1, wma_period + 1)
698698

699699
def linear(w):
700700
def _compute(x):

0 commit comments

Comments
 (0)