From da127501f570c8ad1559d3ee3609ccbc7d3c1a90 Mon Sep 17 00:00:00 2001 From: Kevin Johnson Date: Sun, 27 Mar 2022 12:59:11 -0700 Subject: [PATCH] BUG #506 atrts not in study method --- README.md | 9 +++++---- pandas_ta/candles/cdl_inside.py | 1 + pandas_ta/maps.py | 21 +++++++++++---------- pandas_ta/utils/data/yahoofinance.py | 3 ++- setup.py | 2 +- 5 files changed, 20 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index c2b12df..0f1a684 100644 --- a/README.md +++ b/README.md @@ -198,7 +198,7 @@ $ pip install pandas_ta[full] Latest Version -------------- -Best choice! Version: *0.3.59b* +Best choice! Version: *0.3.60b* * Includes all fixes and updates between **pypi** and what is covered in this README. ```sh $ pip install -U git+https://github.com/twopirllc/pandas-ta @@ -707,6 +707,7 @@ help(ta.study) ```python # Download Chart history using yfinance. (pip install yfinance) # It uses the same keyword arguments as yfinance (excluding start and end) +# Note: It automatically sets the index to be a DatetimeIndex df = df.ta.ticker("aapl") # Default ticker is "SPY" # Period is used instead of start/end @@ -723,9 +724,9 @@ df = df.ta.ticker("aapl", period="1mo", interval="1h") # Gets this past month in # A Ticker & DataFrame Dictionary with a Study applied tickers = ["SPY", "AAPL", "SQ"] s = ta.CommonStudy -asset = {f"{t}_D": ta.df.ta.ticker(t, period="1y", cores=0, study=s, timed=True, returns=True, ds="yf") for t in tickers} -print(asset.keys()) -spydf = asset["SPY_D"] +assets = {f"{t}_D": ta.df.ta.ticker(t, period="1y", cores=0, study=s, timed=True, returns=True, ds="yf") for t in tickers} +print(assets.keys()) +spydf = assets["SPY_D"] # For more info help(ta.yf) diff --git a/pandas_ta/candles/cdl_inside.py b/pandas_ta/candles/cdl_inside.py index 4c73b11..e6036a8 100644 --- a/pandas_ta/candles/cdl_inside.py +++ b/pandas_ta/candles/cdl_inside.py @@ -46,6 +46,7 @@ def cdl_inside( offset = v_offset(offset) # Calculate + # TODO: Return if high or low has nan inside = (high.diff() < 0) & (low.diff() > 0) if not asbool: diff --git a/pandas_ta/maps.py b/pandas_ta/maps.py index 64fe578..cb2caf7 100644 --- a/pandas_ta/maps.py +++ b/pandas_ta/maps.py @@ -48,10 +48,10 @@ Category: Dict[str, ListStr] = { # Momentum "momentum": [ "ao", "apo", "bias", "bop", "brar", "cci", "cfo", "cg", "cmo", - "coppock", "cti", "er", "eri", "fisher", "inertia", "kdj", "kst", "macd", - "mom", "pgo", "ppo", "psl", "pvo", "qqe", "roc", "rsi", "rsx", "rvgi", - "slope", "smi", "squeeze", "squeeze_pro", "stc", "stoch", "stochf", - "stochrsi", "td_seq", "trix", "tsi", "uo", "willr" + "coppock", "cti", "er", "eri", "fisher", "inertia", "kdj", "kst", + "macd", "mom", "pgo", "ppo", "psl", "pvo", "qqe", "roc", "rsi", + "rsx", "rvgi", "slope", "smi", "squeeze", "squeeze_pro", "stc", + "stoch", "stochf", "stochrsi", "td_seq", "trix", "tsi", "uo", "willr" ], # Overlap "overlap": [ @@ -73,20 +73,21 @@ Category: Dict[str, ListStr] = { # Trend "trend": [ "adx", "amat", "aroon", "chop", "cksp", "decay", "decreasing", "dpo", - "increasing", "long_run", "psar", "qstick", "short_run", "trendflex", "tsignals", - "ttm_trend", "vhf", "vortex", "xsignals" + "increasing", "long_run", "psar", "qstick", "short_run", "trendflex", + "tsignals", "ttm_trend", "vhf", "vortex", "xsignals" ], # Volatility "volatility": [ - "aberration", "accbands", "atr", "bbands", "donchian", "hwc", "kc", "massi", - "natr", "pdist", "rvi", "thermo", "true_range", "ui" + "aberration", "accbands", "atr", "atrts", "bbands", "donchian", + "hwc", "kc", "massi", "natr", "pdist", "rvi", "thermo", + "true_range", "ui" ], # Volume. # Note: "vp" or "Volume Profile" is excluded since it does not return a Time Series "volume": [ - "ad", "adosc", "aobv", "cmf", "efi", "eom", "kvo", "mfi", "nvi", "obv", - "pvi", "pvol", "pvr", "pvt", "wb_tsv" + "ad", "adosc", "aobv", "cmf", "efi", "eom", "kvo", "mfi", "nvi", + "obv", "pvi", "pvol", "pvr", "pvt", "wb_tsv" ], } diff --git a/pandas_ta/utils/data/yahoofinance.py b/pandas_ta/utils/data/yahoofinance.py index 370e71d..20da3d2 100644 --- a/pandas_ta/utils/data/yahoofinance.py +++ b/pandas_ta/utils/data/yahoofinance.py @@ -60,7 +60,8 @@ def yf(ticker: str, **kwargs) -> DataFrame: Returns: Exits if the DataFrame is empty or None - Otherwise it returns a DataFrame of the Chart History + Otherwise it returns a DataFrame of the Chart History with a + DatetimeIndex """ verbose = kwargs.pop("verbose", False) if ticker is not None and isinstance(ticker, str) and len(ticker): diff --git a/setup.py b/setup.py index 31b84d8..ca02a92 100644 --- a/setup.py +++ b/setup.py @@ -20,7 +20,7 @@ setup( "pandas_ta.volatility", "pandas_ta.volume" ], - version=".".join(("0", "3", "59b")), + version=".".join(("0", "3", "60b")), description=long_description, long_description=long_description, author="Kevin Johnson",