Skip to content

Commit

Permalink
Merge pull request #128 from bukosabino/develop
Browse files Browse the repository at this point in the history
Fixing bug: hard-coded values
  • Loading branch information
bukosabino authored Mar 12, 2020
2 parents ab347c8 + ce135b0 commit da55f9d
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 12 deletions.
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
setup(
name = 'ta',
packages = ['ta'],
version = '0.5.12',
version = '0.5.13',
description='Technical Analysis Library in Python',
long_description='It is a Technical Analysis library to financial time series datasets. You can use to do feature engineering. It is builded on Python Pandas library.',
author = 'Dario Lopez Padial (Bukosabino)',
Expand All @@ -15,7 +15,7 @@
'numpy',
'pandas',
],
download_url = 'https://github.com/bukosabino/ta/tarball/0.5.12',
download_url = 'https://github.com/bukosabino/ta/tarball/0.5.13',
keywords = ['technical analysis', 'python3', 'pandas'],
license='The MIT License (MIT)',
classifiers = [
Expand Down
11 changes: 6 additions & 5 deletions ta/momentum.py
Original file line number Diff line number Diff line change
Expand Up @@ -609,10 +609,10 @@ def uo(high, low, close, s=7, m=14, len=28, ws=4.0, wm=2.0, wl=1.0, fillna=False
"""
return UltimateOscillator(
high=high, low=low, close=close, s=7, m=14, len=28, ws=4.0, wm=2.0, wl=1.0, fillna=fillna).uo()
high=high, low=low, close=close, s=s, m=m, len=len, ws=ws, wm=wm, wl=wl, fillna=fillna).uo()


def stoch(high, low, close, n=14, fillna=False):
def stoch(high, low, close, n=14, d_n=3, fillna=False):
"""Stochastic Oscillator
Developed in the late 1950s by George Lane. The stochastic
Expand All @@ -627,13 +627,14 @@ def stoch(high, low, close, n=14, fillna=False):
low(pandas.Series): dataset 'Low' column.
close(pandas.Series): dataset 'Close' column.
n(int): n period.
d_n(int): sma period over stoch_k
fillna(bool): if True, fill nan values.
Returns:
pandas.Series: New feature generated.
"""

return StochasticOscillator(high=high, low=low, close=close, n=n, d_n=3, fillna=fillna).stoch()
return StochasticOscillator(high=high, low=low, close=close, n=n, d_n=d_n, fillna=fillna).stoch()


def stoch_signal(high, low, close, n=14, d_n=3, fillna=False):
Expand Down Expand Up @@ -737,7 +738,7 @@ def ao(high, low, s=5, len=34, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
return AwesomeOscillatorIndicator(high=high, low=low, s=s, len=34, fillna=fillna).ao()
return AwesomeOscillatorIndicator(high=high, low=low, s=s, len=len, fillna=fillna).ao()


def kama(close, n=10, pow1=2, pow2=30, fillna=False):
Expand Down Expand Up @@ -792,4 +793,4 @@ def roc(close, n=12, fillna=False):
pandas.Series: New feature generated.
"""
return ROCIndicator(close=close, n=12, fillna=fillna).roc()
return ROCIndicator(close=close, n=n, fillna=fillna).roc()
10 changes: 5 additions & 5 deletions ta/volatility.py
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ def keltner_channel_central(high, low, close, n=10, fillna=False):
Returns:
pandas.Series: New feature generated.
"""
indicator = KeltnerChannel(high=high, low=low, close=close, n=10, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
return indicator.keltner_channel_central()


Expand All @@ -467,7 +467,7 @@ 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=10, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
return indicator.keltner_channel_hband()


Expand All @@ -488,7 +488,7 @@ 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=10, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
return indicator.keltner_channel_lband()


Expand All @@ -510,7 +510,7 @@ 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=10, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
return indicator.keltner_channel_hband_indicator()


Expand All @@ -531,7 +531,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=10, fillna=False)
indicator = KeltnerChannel(high=high, low=low, close=close, n=n, fillna=False)
return indicator.keltner_channel_lband_indicator()


Expand Down

0 comments on commit da55f9d

Please sign in to comment.