Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing bug: hard-coded values #128

Merged
merged 2 commits into from
Mar 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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