Skip to content

Commit

Permalink
Merge branch 'pr/727' into development
Browse files Browse the repository at this point in the history
  • Loading branch information
twopirllc committed Oct 12, 2023
2 parents 2a173b4 + db75b77 commit c85196c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion pandas_ta/overlap/supertrend.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ def supertrend(
high: Series, low: Series, close: Series,
length: Int = None, atr_length: Int = None,
multiplier: IntFloat = None,
atr_mamode : str = None,
offset: Int = None, **kwargs: DictLike
) -> DataFrame:
"""Supertrend (supertrend)
Expand All @@ -31,6 +32,7 @@ def supertrend(
variable of control. Default: length
multiplier (float): Coefficient for upper and lower band distance to
midrange. Default: 3.0
atr_mamode (str) : Can be used to specify the type of MA to be used for ATR calculation.
offset (int): How many periods to offset the result. Default: 0
Kwargs:
Expand Down Expand Up @@ -60,7 +62,7 @@ def supertrend(
long, short = [nan] * m, [nan] * m

hl2_ = hl2(high, low)
matr = multiplier * atr(high, low, close, atr_length)
matr = multiplier * atr(high, low, close, atr_length, mamode=atr_mamode)
lb = hl2_ - matr # Lowerband
ub = hl2_ + matr # Upperband
for i in range(1, m):
Expand Down

0 comments on commit c85196c

Please sign in to comment.