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

Commit dcfd3f3

Browse files
committed
methods which concat two Series return DataFrame
1 parent 22460ba commit dcfd3f3

File tree

1 file changed

+21
-21
lines changed

1 file changed

+21
-21
lines changed

finta/finta.py

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ def MACD(
373373
period_fast: int = 12,
374374
period_slow: int = 26,
375375
signal: int = 9,
376-
) -> Series:
376+
) -> DataFrame:
377377
"""
378378
MACD, MACD Signal and MACD difference.
379379
The MACD Line oscillates above and below the zero line, which is also known as the centerline.
@@ -414,7 +414,7 @@ def PPO(
414414
period_fast: int = 12,
415415
period_slow: int = 26,
416416
signal: int = 9,
417-
) -> Series:
417+
) -> DataFrame:
418418
"""
419419
Percentage Price Oscillator
420420
PPO, PPO Signal and PPO difference.
@@ -449,7 +449,7 @@ def VW_MACD(
449449
period_fast: int = 12,
450450
period_slow: int = 26,
451451
signal: int = 9,
452-
) -> Series:
452+
) -> DataFrame:
453453
""""Volume-Weighted MACD" is an indicator that shows how a volume-weighted moving average can be used to calculate moving average convergence/divergence (MACD).
454454
This technique was first used by Buff Dormeier, CMT, and has been written about since at least 2002."""
455455

@@ -496,7 +496,7 @@ def EV_MACD(
496496
period_fast: int = 20,
497497
period_slow: int = 40,
498498
signal: int = 9,
499-
) -> Series:
499+
) -> DataFrame:
500500
"""
501501
Elastic Volume Weighted MACD is a variation of standard MACD,
502502
calculated using two EVWMA's.
@@ -684,7 +684,7 @@ def SAR(cls, ohlc: DataFrame, af: int = 0.02, amax: int = 0.2) -> Series:
684684
@classmethod
685685
def BBANDS(
686686
cls, ohlc: DataFrame, period: int = 20, MA: Series = None, column: str = "close"
687-
) -> Series:
687+
) -> DataFrame:
688688
"""
689689
Developed by John Bollinger, Bollinger Bands® are volatility bands placed above and below a moving average.
690690
Volatility is based on the standard deviation, which changes as volatility increases and decreases.
@@ -739,7 +739,7 @@ def PERCENT_B(
739739
@classmethod
740740
def KC(
741741
cls, ohlc: DataFrame, period: int = 20, atr_period: int = 10, MA: Series = None, kc_mult: float = 2
742-
) -> Series:
742+
) -> DataFrame:
743743
"""Keltner Channels [KC] are volatility-based envelopes set above and below an exponential moving average.
744744
This indicator is similar to Bollinger Bands, which use the standard deviation to set the bands.
745745
Instead of using the standard deviation, Keltner Channels use the Average True Range (ATR) to set channel distance.
@@ -759,7 +759,7 @@ def KC(
759759
return pd.concat([up, down], axis=1)
760760

761761
@classmethod
762-
def DO(cls, ohlc: DataFrame, period: int = 20) -> Series:
762+
def DO(cls, ohlc: DataFrame, period: int = 20) -> DataFrame:
763763
"""Donchian Channel, a moving average indicator developed by Richard Donchian.
764764
It plots the highest high and lowest low over the last period time intervals."""
765765

@@ -770,7 +770,7 @@ def DO(cls, ohlc: DataFrame, period: int = 20) -> Series:
770770
return pd.concat([lower, middle, upper], axis=1)
771771

772772
@classmethod
773-
def DMI(cls, ohlc: DataFrame, period: int = 14) -> Series:
773+
def DMI(cls, ohlc: DataFrame, period: int = 14) -> DataFrame:
774774
"""The directional movement indicator (also known as the directional movement index - DMI) is a valuable tool
775775
for assessing price direction and strength. This indicator was created in 1978 by J. Welles Wilder, who also created the popular
776776
relative strength index. DMI tells you when to be long or short.
@@ -834,7 +834,7 @@ def ADX(cls, ohlc: DataFrame, period: int = 14) -> Series:
834834
)
835835

836836
@classmethod
837-
def PIVOT(cls, ohlc: DataFrame) -> Series:
837+
def PIVOT(cls, ohlc: DataFrame) -> DataFrame:
838838
"""
839839
Pivot Points are significant support and resistance levels that can be used to determine potential trades.
840840
The pivot points come as a technical analysis indicator calculated using a financial instrument’s high, low, and close value.
@@ -873,7 +873,7 @@ def PIVOT(cls, ohlc: DataFrame) -> Series:
873873
)
874874

875875
@classmethod
876-
def PIVOT_FIB(cls, ohlc: DataFrame) -> Series:
876+
def PIVOT_FIB(cls, ohlc: DataFrame) -> DataFrame:
877877
"""
878878
Fibonacci pivot point levels are determined by first calculating the classic pivot point,
879879
then multiply the previous day’s range with its corresponding Fibonacci level.
@@ -1028,7 +1028,7 @@ def MI(cls, ohlc: DataFrame, period: int = 9) -> Series:
10281028
return pd.Series(mass.rolling(window=25).sum(), name="Mass Index")
10291029

10301030
@classmethod
1031-
def VORTEX(cls, ohlc: DataFrame, period: int = 14) -> Series:
1031+
def VORTEX(cls, ohlc: DataFrame, period: int = 14) -> DataFrame:
10321032
"""The Vortex indicator plots two oscillating lines, one to identify positive trend movement and the other
10331033
to identify negative price movement.
10341034
Indicator construction revolves around the highs and lows of the last two days or periods.
@@ -1051,7 +1051,7 @@ def VORTEX(cls, ohlc: DataFrame, period: int = 14) -> Series:
10511051
@classmethod
10521052
def KST(
10531053
cls, ohlc: DataFrame, r1: int = 10, r2: int = 15, r3: int = 20, r4: int = 30
1054-
) -> Series:
1054+
) -> DataFrame:
10551055
"""Know Sure Thing (KST) is a momentum oscillator based on the smoothed rate-of-change for four different time frames.
10561056
KST measures price momentum for four different price cycles. It can be used just like any momentum oscillator.
10571057
Chartists can look for divergences, overbought/oversold readings, signal line crossovers and centerline crossovers."""
@@ -1069,7 +1069,7 @@ def KST(
10691069
@classmethod
10701070
def TSI(
10711071
cls, ohlc: DataFrame, long: int = 25, short: int = 13, signal: int = 13
1072-
) -> Series:
1072+
) -> DataFrame:
10731073
"""True Strength Index (TSI) is a momentum oscillator based on a double smoothing of price changes."""
10741074

10751075
## Double smoother price change
@@ -1270,7 +1270,7 @@ def CFI(cls, ohlcv: DataFrame) -> Series:
12701270
return cfi.cumsum()
12711271

12721272
@classmethod
1273-
def EBBP(cls, ohlc: DataFrame) -> Series:
1273+
def EBBP(cls, ohlc: DataFrame) -> DataFrame:
12741274
"""Bull power and bear power by Dr. Alexander Elder show where today’s high and low lie relative to the a 13-day EMA"""
12751275

12761276
bull_power = pd.Series(ohlc["high"] - cls.EMA(ohlc, 13), name="Bull.")
@@ -1334,7 +1334,7 @@ def COPP(cls, ohlc: DataFrame) -> Series:
13341334
)
13351335

13361336
@classmethod
1337-
def BASP(cls, ohlc: DataFrame, period: int = 40) -> Series:
1337+
def BASP(cls, ohlc: DataFrame, period: int = 40) -> DataFrame:
13381338
"""BASP indicator serves to identify buying and selling pressure."""
13391339

13401340
sp = ohlc["high"] - ohlc["close"]
@@ -1354,7 +1354,7 @@ def BASP(cls, ohlc: DataFrame, period: int = 40) -> Series:
13541354
return pd.concat([nbfraw, nsfraw], axis=1)
13551355

13561356
@classmethod
1357-
def BASPN(cls, ohlc: DataFrame, period: int = 40) -> Series:
1357+
def BASPN(cls, ohlc: DataFrame, period: int = 40) -> DataFrame:
13581358
"""
13591359
Normalized BASP indicator
13601360
"""
@@ -1393,7 +1393,7 @@ def CMO(cls, ohlc: DataFrame, period: int = 9) -> DataFrame:
13931393
@classmethod
13941394
def CHANDELIER(
13951395
cls, ohlc: DataFrame, period_1: int = 14, period_2: int = 22, k: int = 3
1396-
) -> Series:
1396+
) -> DataFrame:
13971397
"""
13981398
Chandelier Exit sets a trailing stop-loss based on the Average True Range (ATR).
13991399
@@ -1448,7 +1448,7 @@ def TMF(cls, ohlcv: DataFrame, period: int = 21) -> Series:
14481448
@classmethod
14491449
def WTO(
14501450
cls, ohlc: DataFrame, channel_lenght: int = 10, average_lenght: int = 21
1451-
) -> Series:
1451+
) -> DataFrame:
14521452
"""
14531453
Wave Trend Oscillator
14541454
source: http://www.fxcoaching.com/WaveTrend/
@@ -1496,7 +1496,7 @@ def ICHIMOKU(
14961496
kijun_period: int = 26,
14971497
senkou_period: int = 52,
14981498
chikou_period: int = 26,
1499-
) -> Series:
1499+
) -> DataFrame:
15001500
"""
15011501
The Ichimoku Cloud, also known as Ichimoku Kinko Hyo, is a versatile indicator that defines support and resistance,
15021502
identifies trend direction, gauges momentum and provides trading signals.
@@ -1547,7 +1547,7 @@ def ICHIMOKU(
15471547
@classmethod
15481548
def APZ(
15491549
cls, ohlc: DataFrame, period: int = 21, dev_factor: int = 2, MA: Series = None
1550-
) -> Series:
1550+
) -> DataFrame:
15511551
"""
15521552
The adaptive price zone (APZ) is a technical indicator developed by Lee Leibfarth.
15531553
@@ -1598,7 +1598,7 @@ def VR(cls, ohlc: DataFrame, period: int = 14) -> Series:
15981598
return vr
15991599

16001600
@classmethod
1601-
def SQZMI(cls, ohlc: DataFrame, period: int = 20, MA: Series = None) -> Series:
1601+
def SQZMI(cls, ohlc: DataFrame, period: int = 20, MA: Series = None) -> DataFrame:
16021602
"""
16031603
Squeeze Momentum Indicator
16041604

0 commit comments

Comments
 (0)