Skip to content

Commit

Permalink
exposing ov parameter for keltner channel functions #131 (comment)
Browse files Browse the repository at this point in the history
  • Loading branch information
bukosabino committed Mar 29, 2020
1 parent e6cb52a commit 89e0da0
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions ta/volatility.py
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ def bollinger_lband_indicator(close, n=20, ndev=2, fillna=False):
return indicator.bollinger_lband_indicator()


def keltner_channel_mband(high, low, close, n=10, fillna=False):
def keltner_channel_mband(high, low, close, n=10, fillna=False, ov=True):
"""Keltner channel (KC)
Showing a simple moving average line (central) of typical price.
Expand All @@ -516,11 +516,11 @@ def keltner_channel_mband(high, low, close, n=10, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False, ov=ov)
return indicator.keltner_channel_mband()


def keltner_channel_hband(high, low, close, n=10, fillna=False):
def keltner_channel_hband(high, low, close, n=10, fillna=False, ov=True):
"""Keltner channel (KC)
Showing a simple moving average line (high) of typical price.
Expand All @@ -537,11 +537,11 @@ def keltner_channel_hband(high, low, close, n=10, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False, ov=ov)
return indicator.keltner_channel_hband()


def keltner_channel_lband(high, low, close, n=10, fillna=False):
def keltner_channel_lband(high, low, close, n=10, fillna=False, ov=True):
"""Keltner channel (KC)
Showing a simple moving average line (low) of typical price.
Expand All @@ -558,11 +558,11 @@ def keltner_channel_lband(high, low, close, n=10, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False, ov=ov)
return indicator.keltner_channel_lband()


def keltner_channel_wband(high, low, close, n=10, fillna=False):
def keltner_channel_wband(high, low, close, n=10, fillna=False, ov=True):
"""Keltner Channel Band Width
https://en.wikipedia.org/wiki/Keltner_channel
Expand All @@ -577,11 +577,11 @@ def keltner_channel_wband(high, low, close, n=10, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False, ov=ov)
return indicator.keltner_channel_wband()


def keltner_channel_pband(high, low, close, n=10, fillna=False):
def keltner_channel_pband(high, low, close, n=10, fillna=False, ov=True):
"""Keltner Channel Percentage Band
https://en.wikipedia.org/wiki/Keltner_channel
Expand All @@ -596,11 +596,11 @@ def keltner_channel_pband(high, low, close, n=10, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False, ov=ov)
return indicator.keltner_channel_pband()


def keltner_channel_hband_indicator(high, low, close, n=10, fillna=False):
def keltner_channel_hband_indicator(high, low, close, n=10, fillna=False, ov=True):
"""Keltner Channel High Band Indicator (KC)
Returns 1, if close is higher than keltner high band channel. Else,
Expand All @@ -618,11 +618,11 @@ def keltner_channel_hband_indicator(high, low, close, n=10, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False, ov=ov)
return indicator.keltner_channel_hband_indicator()


def keltner_channel_lband_indicator(high, low, close, n=10, fillna=False):
def keltner_channel_lband_indicator(high, low, close, n=10, fillna=False, ov=True):
"""Keltner Channel Low Band Indicator (KC)
Returns 1, if close is lower than keltner low band channel. Else, return 0.
Expand All @@ -639,7 +639,7 @@ def keltner_channel_lband_indicator(high, low, close, n=10, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False, ov=ov)
return indicator.keltner_channel_lband_indicator()


Expand Down

0 comments on commit 89e0da0

Please sign in to comment.