mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-08-12 12:20:27 +08:00
MAINT swap strategy with study
This commit is contained in:
@@ -198,7 +198,7 @@ $ pip install pandas_ta[full]
|
||||
|
||||
Latest Version
|
||||
--------------
|
||||
Best choice! Version: *0.3.57b*
|
||||
Best choice! Version: *0.3.58b*
|
||||
* 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
|
||||
|
||||
+25
-25
@@ -558,7 +558,31 @@ class AnalysisIndicators(object):
|
||||
disabled when using it's replacement method: df.ta.study().
|
||||
Default: True
|
||||
"""
|
||||
_dep_warning = kwargs.pop("warning", True)
|
||||
kwargs.update({"warning": True})
|
||||
return self.study(*args, **kwargs)
|
||||
|
||||
def study(self, *args: Args, **kwargs: DictLike) -> dataclass:
|
||||
"""Study Method
|
||||
|
||||
An experimental method that by default runs all applicable indicators.
|
||||
|
||||
Kwargs:
|
||||
chunksize (bool): Adjust the chunksize for the Multiprocessing Pool.
|
||||
Default: Number of cores of the OS
|
||||
exclude (list): List of indicator names to exclude. Some are
|
||||
excluded by default for various reasons; they require additional
|
||||
sources, performance (td_seq), not a time series chart (vp) etc.
|
||||
name (str): Select all indicators or indicators by
|
||||
Category such as: "candles", "cycles", "momentum", "overlap",
|
||||
"performance", "statistics", "trend", "volatility", "volume", or
|
||||
"all". Default: "all"
|
||||
ordered (bool): Whether to run "all" in order. Default: True
|
||||
timed (bool): Show the process time of the study().
|
||||
Default: False
|
||||
verbose (bool): Provide some additional insight on the progress of
|
||||
the study() execution. Default: False
|
||||
"""
|
||||
_dep_warning = kwargs.pop("warning", False)
|
||||
all_ordered = kwargs.pop("ordered", True)
|
||||
# Append indicators to the DataFrame by default
|
||||
kwargs.setdefault("append", True)
|
||||
@@ -734,30 +758,6 @@ class AnalysisIndicators(object):
|
||||
if returns:
|
||||
return self._df
|
||||
|
||||
def study(self, *args: Args, **kwargs: DictLike) -> dataclass:
|
||||
"""Study Method
|
||||
|
||||
An experimental method that by default runs all applicable indicators.
|
||||
|
||||
Kwargs:
|
||||
chunksize (bool): Adjust the chunksize for the Multiprocessing Pool.
|
||||
Default: Number of cores of the OS
|
||||
exclude (list): List of indicator names to exclude. Some are
|
||||
excluded by default for various reasons; they require additional
|
||||
sources, performance (td_seq), not a time series chart (vp) etc.
|
||||
name (str): Select all indicators or indicators by
|
||||
Category such as: "candles", "cycles", "momentum", "overlap",
|
||||
"performance", "statistics", "trend", "volatility", "volume", or
|
||||
"all". Default: "all"
|
||||
ordered (bool): Whether to run "all" in order. Default: True
|
||||
timed (bool): Show the process time of the study().
|
||||
Default: False
|
||||
verbose (bool): Provide some additional insight on the progress of
|
||||
the study() execution. Default: False
|
||||
"""
|
||||
kwargs.update({"warning": False})
|
||||
return self.strategy(*args, **kwargs)
|
||||
|
||||
def ticker(self, ticker: str, ds: str = None, **kwargs: DictLike):
|
||||
"""ticker
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ setup(
|
||||
"pandas_ta.volatility",
|
||||
"pandas_ta.volume"
|
||||
],
|
||||
version=".".join(("0", "3", "57b")),
|
||||
version=".".join(("0", "3", "58b")),
|
||||
description=long_description,
|
||||
long_description=long_description,
|
||||
author="Kevin Johnson",
|
||||
|
||||
+2
-1
@@ -18,8 +18,8 @@ timed_test = False
|
||||
timed = True
|
||||
verbose = VERBOSE
|
||||
|
||||
class TestStudyMethods(TestCase):
|
||||
|
||||
class TestStudyMethods(TestCase):
|
||||
@classmethod
|
||||
def setUpClass(cls):
|
||||
cls.data = sample_data
|
||||
@@ -112,6 +112,7 @@ class TestStudyMethods(TestCase):
|
||||
self.category = "Candles"
|
||||
self.data.ta.study(pandas_ta.AllStudy, verbose=verbose, timed=timed_test)
|
||||
|
||||
@skipUnless(verbose, "verbose mode only")
|
||||
def test_all_without_append(self):
|
||||
"""Study: All sans append"""
|
||||
self.category = "All: Sans append"
|
||||
|
||||
Reference in New Issue
Block a user