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

Commit

Permalink
Merge branch 'master' of https://github.com/peerchemist/finta
Browse files Browse the repository at this point in the history
  • Loading branch information
peerchemist committed Apr 16, 2020
2 parents 1f2c609 + 271c9a8 commit c1fd659
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions finta/finta.py
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,7 @@ def SAR(cls, ohlc: DataFrame, af: int = 0.02, amax: int = 0.2) -> Series:

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

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

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

Expand Down

0 comments on commit c1fd659

Please sign in to comment.