Skip to content

Commit

Permalink
few more input validators
Browse files Browse the repository at this point in the history
  • Loading branch information
peerchemist committed Oct 27, 2020
1 parent 9cd3fac commit 725d4d9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion finta/finta.py
Original file line number Diff line number Diff line change
Expand Up @@ -1437,6 +1437,7 @@ def CHAIKIN(cls, ohlcv: DataFrame, adjust: bool = True) -> Series:
)

@classmethod
@inputvalidator(input_="ohlcv")
def MFI(cls, ohlc: DataFrame, period: int = 14) -> Series:
"""The money flow index (MFI) is a momentum indicator that measures
the inflow and outflow of money into a security over a specific period of time.
Expand Down Expand Up @@ -1516,6 +1517,7 @@ def WOBV(cls, ohlcv: DataFrame, column: str = "close") -> Series:
return wobv.cumsum()

@classmethod
@inputvalidator(input_="ohlcv")
def VZO(
cls,
ohlc: DataFrame,
Expand Down Expand Up @@ -1549,7 +1551,7 @@ def PZO(
then the closing price will have a positive value (bullish); otherwise it will have a negative value (bearish).
source: http://traders.com/Documentation/FEEDbk_docs/2011/06/Khalil.html
:period: Specifies the number of Periods used for eVWMA calculation
:period: Specifies the number of Periods used for PZO calculation
"""

sign = lambda a: (a > 0) - (a < 0)
Expand Down Expand Up @@ -1972,6 +1974,7 @@ def sqz_on(row):
return pd.Series(comb["SQZ"], name="{0} period SQZMI".format(period))

@classmethod
@inputvalidator(input_="ohlcv")
def VPT(cls, ohlc: DataFrame) -> Series:
"""
Volume Price Trend
Expand All @@ -1990,6 +1993,7 @@ def VPT(cls, ohlc: DataFrame) -> Series:
return pd.Series(vpt, name="VPT")

@classmethod
@inputvalidator(input_="ohlcv")
def FVE(cls, ohlc: DataFrame, period: int = 22, factor: int = 0.3) -> Series:
"""
FVE is a money flow indicator, but it has two important innovations: first, the F VE takes into account both intra and
Expand Down

0 comments on commit 725d4d9

Please sign in to comment.