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

Commit c1fd659

Browse files
committed
Merge branch 'master' of https://github.com/peerchemist/finta
2 parents 1f2c609 + 271c9a8 commit c1fd659

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

finta/finta.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ def SAR(cls, ohlc: DataFrame, af: int = 0.02, amax: int = 0.2) -> Series:
708708

709709
@classmethod
710710
def BBANDS(
711-
cls, ohlc: DataFrame, period: int = 20, MA: Series = None, column: str = "close"
711+
cls, ohlc: DataFrame, period: int = 20, MA: Series = None, column: str = "close", std_multiplier: int = 2
712712
) -> DataFrame:
713713
"""
714714
Developed by John Bollinger, Bollinger Bands® are volatility bands placed above and below a moving average.
@@ -726,8 +726,8 @@ def BBANDS(
726726
else:
727727
middle_band = pd.Series(MA, name="BB_MIDDLE")
728728

729-
upper_bb = pd.Series(middle_band + (2 * std), name="BB_UPPER")
730-
lower_bb = pd.Series(middle_band - (2 * std), name="BB_LOWER")
729+
upper_bb = pd.Series(middle_band + (std_multiplier * std), name="BB_UPPER")
730+
lower_bb = pd.Series(middle_band - (std_multiplier * std), name="BB_LOWER")
731731

732732
return pd.concat([upper_bb, middle_band, lower_bb], axis=1)
733733

0 commit comments

Comments
 (0)