diff --git a/pandas_ta/overlap/alligator.py b/pandas_ta/overlap/alligator.py index 2ed3d4e..76e93c0 100644 --- a/pandas_ta/overlap/alligator.py +++ b/pandas_ta/overlap/alligator.py @@ -1,11 +1,12 @@ # -*- coding: utf-8 -*- # from numpy import nan as npNaN -from pandas import DataFrame +from pandas import DataFrame, Series from .smma import smma from pandas_ta.utils import get_offset, verify_series -def alligator(close, jaw=None, teeth=None, lips=None, talib=None, offset=None, **kwargs): +def alligator(close: Series, jaw: int = None, teeth: int = None, lips: int = None, talib: bool = None, + offset: int = None, **kwargs) -> DataFrame: """Bill Williams Alligator (ALLIGATOR) The Alligator Indicator was developed by Bill Williams and combines moving diff --git a/pandas_ta/overlap/alma.py b/pandas_ta/overlap/alma.py index 72690c1..90ed17a 100644 --- a/pandas_ta/overlap/alma.py +++ b/pandas_ta/overlap/alma.py @@ -11,7 +11,8 @@ from pandas import Series from pandas_ta.utils import get_offset, strided_window, verify_series -def alma(close, length=None, sigma=None, dist_offset=None, offset=None, **kwargs): +def alma(close: Series, length: int = None, sigma: float = None, dist_offset: float = None, offset: int = None, + **kwargs) -> Series: """Arnaud Legoux Moving Average (ALMA) The ALMA moving average uses the curve of the Normal (Gauss) distribution, which diff --git a/pandas_ta/overlap/dema.py b/pandas_ta/overlap/dema.py index 149e8f1..9a84c6f 100644 --- a/pandas_ta/overlap/dema.py +++ b/pandas_ta/overlap/dema.py @@ -2,9 +2,10 @@ from .ema import ema from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def dema(close, length=None, talib=None, offset=None, **kwargs): +def dema(close: Series, length: int = None, talib: bool = None, offset: int = None, **kwargs) -> Series: """Double Exponential Moving Average (DEMA) The Double Exponential Moving Average attempts to a smoother average with less diff --git a/pandas_ta/overlap/ema.py b/pandas_ta/overlap/ema.py index 70682ef..734b515 100644 --- a/pandas_ta/overlap/ema.py +++ b/pandas_ta/overlap/ema.py @@ -2,9 +2,10 @@ from numpy import nan as npNaN from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def ema(close, length=None, talib=None, offset=None, **kwargs): +def ema(close: Series, length: int = None, talib: bool = None, offset: int = None, **kwargs) -> Series: """Exponential Moving Average (EMA) The Exponential Moving Average is more responsive moving average compared to the diff --git a/pandas_ta/overlap/fwma.py b/pandas_ta/overlap/fwma.py index cdd7733..7a9c8f9 100644 --- a/pandas_ta/overlap/fwma.py +++ b/pandas_ta/overlap/fwma.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from pandas_ta.utils import fibonacci, get_offset, verify_series, weights +from pandas import Series -def fwma(close, length=None, asc=None, offset=None, **kwargs): +def fwma(close: Series, length: int = None, asc: bool = None, offset: int = None, **kwargs) -> Series: """Fibonacci's Weighted Moving Average (FWMA) Fibonacci's Weighted Moving Average is similar to a Weighted Moving Average diff --git a/pandas_ta/overlap/hilo.py b/pandas_ta/overlap/hilo.py index c467442..fdc59a1 100644 --- a/pandas_ta/overlap/hilo.py +++ b/pandas_ta/overlap/hilo.py @@ -5,7 +5,8 @@ from .ma import ma from pandas_ta.utils import get_offset, verify_series -def hilo(high, low, close, high_length=None, low_length=None, mamode=None, offset=None, **kwargs): +def hilo(high: Series, low: Series, close: Series, high_length: int = None, low_length: int = None, + mamode: str = None, offset: int = None, **kwargs) -> DataFrame: """Gann HiLo Activator(HiLo) The Gann High Low Activator Indicator was created by Robert Krausz in a 1998 diff --git a/pandas_ta/overlap/hl2.py b/pandas_ta/overlap/hl2.py index a5236e9..675d10a 100644 --- a/pandas_ta/overlap/hl2.py +++ b/pandas_ta/overlap/hl2.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def hl2(high, low, offset=None, **kwargs): +def hl2(high: Series, low: Series, offset: int = None, **kwargs) -> Series: """HL2 HL2 is the midpoint/average of high and low. diff --git a/pandas_ta/overlap/hlc3.py b/pandas_ta/overlap/hlc3.py index 4c3b241..2c43135 100644 --- a/pandas_ta/overlap/hlc3.py +++ b/pandas_ta/overlap/hlc3.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def hlc3(high, low, close, talib=None, offset=None, **kwargs): +def hlc3(high: Series, low: Series, close: Series, talib: bool = None, offset: int = None, **kwargs) -> Series: """HLC3 HLC3 is the average of high, low and close. diff --git a/pandas_ta/overlap/hma.py b/pandas_ta/overlap/hma.py index 05413bd..1ecd331 100644 --- a/pandas_ta/overlap/hma.py +++ b/pandas_ta/overlap/hma.py @@ -2,9 +2,10 @@ from numpy import sqrt as npSqrt from .wma import wma from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def hma(close, length=None, offset=None, **kwargs): +def hma(close: Series, length: int = None, offset: int = None, **kwargs) -> Series: """Hull Moving Average (HMA) The Hull Exponential Moving Average attempts to reduce or remove lag in moving diff --git a/pandas_ta/overlap/hwma.py b/pandas_ta/overlap/hwma.py index a03f769..5f3de6c 100644 --- a/pandas_ta/overlap/hwma.py +++ b/pandas_ta/overlap/hwma.py @@ -3,7 +3,7 @@ from pandas import Series from pandas_ta.utils import get_offset, verify_series -def hwma(close, na=None, nb=None, nc=None, offset=None, **kwargs): +def hwma(close: Series, na: float = None, nb: float = None, nc: float = None, offset: int = None, **kwargs) -> Series: """HWMA (Holt-Winter Moving Average) Indicator HWMA (Holt-Winter Moving Average) is a three-parameter moving average diff --git a/pandas_ta/overlap/ichimoku.py b/pandas_ta/overlap/ichimoku.py index f0cc4c1..79ef8d2 100644 --- a/pandas_ta/overlap/ichimoku.py +++ b/pandas_ta/overlap/ichimoku.py @@ -1,10 +1,11 @@ # -*- coding: utf-8 -*- -from pandas import date_range, DataFrame, RangeIndex, Timedelta +from pandas import date_range, DataFrame, RangeIndex, Timedelta, Series from .midprice import midprice from pandas_ta.utils import get_offset, verify_series -def ichimoku(high, low, close, tenkan=None, kijun=None, senkou=None, include_chikou=True, offset=None, **kwargs): +def ichimoku(high: Series, low: Series, close: Series, tenkan: int = None, kijun: int = None, senkou: int = None, + include_chikou: bool = True, offset: int = None, **kwargs) -> DataFrame: """Ichimoku Kinkō Hyō (ichimoku) Developed Pre WWII as a forecasting model for financial markets. diff --git a/pandas_ta/overlap/jma.py b/pandas_ta/overlap/jma.py index ebd851b..24368d6 100644 --- a/pandas_ta/overlap/jma.py +++ b/pandas_ta/overlap/jma.py @@ -9,7 +9,7 @@ from pandas import Series from pandas_ta.utils import get_offset, verify_series -def jma(close, length=None, phase=None, offset=None, **kwargs): +def jma(close: Series, length: int = None, phase: float = None, offset: int = None, **kwargs) -> Series: """Jurik Moving Average Average (JMA) Mark Jurik's Moving Average (JMA) attempts to eliminate noise to see the "true" diff --git a/pandas_ta/overlap/kama.py b/pandas_ta/overlap/kama.py index aa75b40..f11e898 100644 --- a/pandas_ta/overlap/kama.py +++ b/pandas_ta/overlap/kama.py @@ -5,7 +5,8 @@ from pandas_ta.overlap.ma import ma from pandas_ta.utils import get_drift, get_offset, non_zero_range, verify_series -def kama(close, length=None, fast=None, slow=None, mamode=None, drift=None, offset=None, **kwargs): +def kama(close: Series, length: int = None, fast: int = None, slow: int = None, mamode: str = None, + drift: int = None, offset: int = None, **kwargs) -> Series: """Kaufman's Adaptive Moving Average (KAMA) Developed by Perry Kaufman, Kaufman's Adaptive Moving Average (KAMA) is a moving average diff --git a/pandas_ta/overlap/linreg.py b/pandas_ta/overlap/linreg.py index f673ef2..d28e948 100644 --- a/pandas_ta/overlap/linreg.py +++ b/pandas_ta/overlap/linreg.py @@ -9,7 +9,7 @@ from pandas_ta import Imports from pandas_ta.utils import get_offset, strided_window, verify_series -def linreg(close, length=None, talib=None, offset=None, **kwargs): +def linreg(close: Series, length: int = None, talib: int = None, offset: int = None, **kwargs) -> Series: """Linear Regression Moving Average (linreg) Linear Regression Moving Average (LINREG). This is a simplified version of a diff --git a/pandas_ta/overlap/ma.py b/pandas_ta/overlap/ma.py index c4b7134..b87346a 100644 --- a/pandas_ta/overlap/ma.py +++ b/pandas_ta/overlap/ma.py @@ -19,7 +19,7 @@ from .vidya import vidya from .wma import wma -def ma(name:str = None, source:Series = None, **kwargs) -> Series: +def ma(name: str = None, source: Series = None, **kwargs) -> Series: """Simple MA Utility for easier MA selection Available MAs: @@ -50,7 +50,7 @@ def ma(name:str = None, source:Series = None, **kwargs) -> Series: return _mas elif isinstance(name, str) and name.lower() in _mas: name = name.lower() - else: # "ema" + else: # "ema" name = _mas[1] if name == "dema": return dema(source, **kwargs) diff --git a/pandas_ta/overlap/mcgd.py b/pandas_ta/overlap/mcgd.py index 8607314..1f65d15 100644 --- a/pandas_ta/overlap/mcgd.py +++ b/pandas_ta/overlap/mcgd.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def mcgd(close, length=None, offset=None, c=None, **kwargs): +def mcgd(close: Series, length: int = None, offset: int = None, c: float = None, **kwargs) -> Series: """McGinley Dynamic Indicator The McGinley Dynamic looks like a moving average line, yet it is actually a diff --git a/pandas_ta/overlap/midpoint.py b/pandas_ta/overlap/midpoint.py index dd678d0..3fa7672 100644 --- a/pandas_ta/overlap/midpoint.py +++ b/pandas_ta/overlap/midpoint.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def midpoint(close, length=None, talib=None, offset=None, **kwargs): +def midpoint(close: Series, length: int = None, talib: bool = None, offset: int = None, **kwargs) -> Series: """Midpoint The Midpoint is the average of the rolling high and low of period length. diff --git a/pandas_ta/overlap/midprice.py b/pandas_ta/overlap/midprice.py index 08d1aff..508f905 100644 --- a/pandas_ta/overlap/midprice.py +++ b/pandas_ta/overlap/midprice.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def midprice(high, low, length=None, talib=None, offset=None, **kwargs): +def midprice(high: Series, low: Series, length: int = None, talib: bool = None, offset: int = None, + **kwargs) -> Series: """Midprice The Midprice is the average of the rolling high and low of period length. diff --git a/pandas_ta/overlap/ohlc4.py b/pandas_ta/overlap/ohlc4.py index 02495aa..d7e4461 100644 --- a/pandas_ta/overlap/ohlc4.py +++ b/pandas_ta/overlap/ohlc4.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def ohlc4(open_, high, low, close, offset=None, **kwargs): +def ohlc4(open_: Series, high: Series, low: Series, close: Series, offset: int = None, **kwargs) -> Series: """OHLC4 OHLC4 is the average of open, high, low and close. diff --git a/pandas_ta/overlap/pwma.py b/pandas_ta/overlap/pwma.py index c0fe60e..179e114 100644 --- a/pandas_ta/overlap/pwma.py +++ b/pandas_ta/overlap/pwma.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from pandas_ta.utils import get_offset, pascals_triangle, verify_series, weights +from pandas import Series -def pwma(close, length=None, asc=None, offset=None, **kwargs): +def pwma(close: Series, length: int = None, asc: bool = None, offset: bool = None, **kwargs) -> Series: """Pascal's Weighted Moving Average (PWMA) Pascal's Weighted Moving Average is similar to a symmetric triangular window diff --git a/pandas_ta/overlap/rma.py b/pandas_ta/overlap/rma.py index 0e1e5fb..f208b72 100644 --- a/pandas_ta/overlap/rma.py +++ b/pandas_ta/overlap/rma.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def rma(close, length=None, offset=None, **kwargs): +def rma(close: Series, length: int = None, offset: int = None, **kwargs) -> Series: """wildeR's Moving Average (RMA) The WildeR's Moving Average is simply an Exponential Moving Average (EMA) with diff --git a/pandas_ta/overlap/sinwma.py b/pandas_ta/overlap/sinwma.py index f7a50bd..114cc35 100644 --- a/pandas_ta/overlap/sinwma.py +++ b/pandas_ta/overlap/sinwma.py @@ -5,7 +5,7 @@ from pandas import Series from pandas_ta.utils import get_offset, verify_series, weights -def sinwma(close, length=None, offset=None, **kwargs): +def sinwma(close: Series, length: int = None, offset: int = None, **kwargs) -> Series: """Sine Weighted Moving Average (SWMA) A weighted average using sine cycles. The middle term(s) of the average have the diff --git a/pandas_ta/overlap/sma.py b/pandas_ta/overlap/sma.py index 59381f7..8b1a803 100644 --- a/pandas_ta/overlap/sma.py +++ b/pandas_ta/overlap/sma.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def sma(close, length=None, talib=None, offset=None, **kwargs): +def sma(close: Series, length: int = None, talib: bool = None, offset: int = None, **kwargs) -> Series: """Simple Moving Average (SMA) The Simple Moving Average is the classic moving average that is the equally diff --git a/pandas_ta/overlap/smma.py b/pandas_ta/overlap/smma.py index 1c6f3cc..2d3dc02 100644 --- a/pandas_ta/overlap/smma.py +++ b/pandas_ta/overlap/smma.py @@ -1,10 +1,12 @@ # -*- coding: utf-8 -*- from numpy import nan as npNaN from pandas_ta.overlap.ma import ma +from pandas import Series from pandas_ta.utils import get_offset, verify_series -def smma(close, length=None, mamode=None, talib=None, offset=None, **kwargs): +def smma(close: Series, length: int = None, mamode: str = None, talib: bool = None, offset: int = None, + **kwargs) -> Series: """SMoothed Moving Average (SMMA) The SMoothed Moving Average (SMMA) is bootstrapped by default with a Simple diff --git a/pandas_ta/overlap/ssf.py b/pandas_ta/overlap/ssf.py index 5707b74..c0bdebd 100644 --- a/pandas_ta/overlap/ssf.py +++ b/pandas_ta/overlap/ssf.py @@ -5,9 +5,10 @@ from numpy import nan as npNaN from numpy import pi as npPi from numpy import sqrt as npSqrt from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def ssf(close, length=None, poles=None, offset=None, **kwargs): +def ssf(close: Series, length: int = None, poles: int = None, offset: int = None, **kwargs) -> Series: """Ehler's Super Smoother Filter (SSF) © 2013 John F. Ehlers's solution to reduce lag and remove aliasing noise with his diff --git a/pandas_ta/overlap/supertrend.py b/pandas_ta/overlap/supertrend.py index d192eca..3756d32 100644 --- a/pandas_ta/overlap/supertrend.py +++ b/pandas_ta/overlap/supertrend.py @@ -1,12 +1,13 @@ # -*- coding: utf-8 -*- from numpy import nan as npNaN -from pandas import DataFrame +from pandas import DataFrame, Series from pandas_ta.overlap import hl2 from pandas_ta.volatility import atr from pandas_ta.utils import get_offset, verify_series -def supertrend(high, low, close, length=None, multiplier=None, offset=None, **kwargs): +def supertrend(high: Series, low: Series, close: Series, length: int = None, multiplier: float = None, + offset: int = None, **kwargs) -> DataFrame: """Supertrend (supertrend) Supertrend is an overlap indicator. It is used to help identify trend diff --git a/pandas_ta/overlap/swma.py b/pandas_ta/overlap/swma.py index 91d32bb..d1df218 100644 --- a/pandas_ta/overlap/swma.py +++ b/pandas_ta/overlap/swma.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- from pandas_ta.utils import get_offset, symmetric_triangle, verify_series, weights +from pandas import Series -def swma(close, length=None, asc=None, offset=None, **kwargs): +def swma(close: Series, length: int = None, asc: bool = None, offset: int = None, **kwargs) -> Series: """Symmetric Weighted Moving Average (SWMA) Symmetric Weighted Moving Average where weights are based on a symmetric diff --git a/pandas_ta/overlap/t3.py b/pandas_ta/overlap/t3.py index e37f157..a8ade10 100644 --- a/pandas_ta/overlap/t3.py +++ b/pandas_ta/overlap/t3.py @@ -2,9 +2,10 @@ from .ema import ema from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def t3(close, length=None, a=None, talib=None, offset=None, **kwargs): +def t3(close: Series, length: int = None, a: float = None, talib: bool = None, offset: int = None, **kwargs) -> Series: """Tim Tillson's T3 Moving Average (T3) Tim Tillson's T3 Moving Average is considered a smoother and more responsive diff --git a/pandas_ta/overlap/tema.py b/pandas_ta/overlap/tema.py index 10b3096..7e20e33 100644 --- a/pandas_ta/overlap/tema.py +++ b/pandas_ta/overlap/tema.py @@ -2,9 +2,10 @@ from .ema import ema from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def tema(close, length=None, talib=None, offset=None, **kwargs): +def tema(close: Series, length: int = None, talib: bool = None, offset: int = None, **kwargs) -> Series: """Triple Exponential Moving Average (TEMA) A less laggy Exponential Moving Average. diff --git a/pandas_ta/overlap/trima.py b/pandas_ta/overlap/trima.py index 76f0bdc..11f3186 100644 --- a/pandas_ta/overlap/trima.py +++ b/pandas_ta/overlap/trima.py @@ -2,9 +2,10 @@ from .sma import sma from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def trima(close, length=None, talib=None, offset=None, **kwargs): +def trima(close: Series, length: int = None, talib: bool = None, offset: int = None, **kwargs) -> Series: """Triangular Moving Average (TRIMA) A weighted moving average where the shape of the weights are triangular and the diff --git a/pandas_ta/overlap/vidya.py b/pandas_ta/overlap/vidya.py index 0c0273a..32b6b5f 100644 --- a/pandas_ta/overlap/vidya.py +++ b/pandas_ta/overlap/vidya.py @@ -4,7 +4,7 @@ from pandas import Series from pandas_ta.utils import get_drift, get_offset, verify_series -def vidya(close, length=None, drift=None, offset=None, **kwargs): +def vidya(close: Series, length: int = None, drift: int = None, offset: int = None, **kwargs) -> Series: """Variable Index Dynamic Average (VIDYA) Variable Index Dynamic Average (VIDYA) was developed by Tushar Chande. It is diff --git a/pandas_ta/overlap/vwap.py b/pandas_ta/overlap/vwap.py index 591a378..b328a11 100644 --- a/pandas_ta/overlap/vwap.py +++ b/pandas_ta/overlap/vwap.py @@ -1,8 +1,11 @@ # -*- coding: utf-8 -*- from .hlc3 import hlc3 from pandas_ta.utils import get_offset, is_datetime_ordered, verify_series +from pandas import Series -def vwap(high, low, close, volume, anchor=None, offset=None, **kwargs): + +def vwap(high: Series, low: Series, close: Series, volume: Series, anchor: str = None, offset: int = None, + **kwargs) -> Series: """Volume Weighted Average Price (VWAP) The Volume Weighted Average Price that measures the average typical price diff --git a/pandas_ta/overlap/vwma.py b/pandas_ta/overlap/vwma.py index 205fa7c..6f531c7 100644 --- a/pandas_ta/overlap/vwma.py +++ b/pandas_ta/overlap/vwma.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- from .sma import sma from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def vwma(close, volume, length=None, offset=None, **kwargs): +def vwma(close: Series, volume: Series, length: int = None, offset: int = None, **kwargs) -> Series: """Volume Weighted Moving Average (VWMA) Volume Weighted Moving Average. diff --git a/pandas_ta/overlap/wcp.py b/pandas_ta/overlap/wcp.py index a234eeb..e7c9471 100644 --- a/pandas_ta/overlap/wcp.py +++ b/pandas_ta/overlap/wcp.py @@ -1,9 +1,10 @@ # -*- coding: utf-8 -*- from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def wcp(high, low, close, talib=None, offset=None, **kwargs): +def wcp(high: Series, low: Series, close: Series, talib: bool = None, offset: int = None, **kwargs) -> Series: """Weighted Closing Price (WCP) Weighted Closing Price is the weighted price given: high, low diff --git a/pandas_ta/overlap/wma.py b/pandas_ta/overlap/wma.py index b77a70a..6fbb943 100644 --- a/pandas_ta/overlap/wma.py +++ b/pandas_ta/overlap/wma.py @@ -4,7 +4,8 @@ from pandas_ta import Imports from pandas_ta.utils import get_offset, verify_series -def wma(close, length=None, asc=None, talib=None, offset=None, **kwargs): +def wma(close: Series, length: int = None, asc: bool = None, talib: bool = None, offset: int = None, + **kwargs) -> Series: """Weighted Moving Average (WMA) The Weighted Moving Average where the weights are linearly increasing and diff --git a/pandas_ta/overlap/zlma.py b/pandas_ta/overlap/zlma.py index a2a0c83..92425bb 100644 --- a/pandas_ta/overlap/zlma.py +++ b/pandas_ta/overlap/zlma.py @@ -4,9 +4,10 @@ # ) from pandas_ta.overlap import ma from pandas_ta.utils import get_offset, verify_series +from pandas import Series -def zlma(close, length=None, mamode=None, offset=None, **kwargs): +def zlma(close: Series, length: int = None, mamode: str = None, offset: int = None, **kwargs) -> Series: """Zero Lag Moving Average (ZLMA) The Zero Lag Moving Average attempts to eliminate the lag associated