mirror of
https://github.com/wassname/pandas-ta.git
synced 2026-08-15 12:45:08 +08:00
add-ttm-trend
This commit is contained in:
+1
-1
@@ -838,7 +838,7 @@ class AnalysisIndicators(BasePandasObject):
|
||||
result = stoch(high=high, low=low, close=close, fast_k=fast_k, slow_k=slow_k, slow_d=slow_d, offset=offset, **kwargs)
|
||||
return result
|
||||
|
||||
@finalize
|
||||
@finalize
|
||||
def ttm_trend(self, high=None, low=None, close=None, offset=None, length=None, **kwargs):
|
||||
high = self._get_column(high, "high")
|
||||
low = self._get_column(low, "low")
|
||||
|
||||
@@ -154,7 +154,7 @@ class TestTrend(TestCase):
|
||||
self.assertIsInstance(result, Series)
|
||||
self.assertEqual(result.name, "SR_2")
|
||||
|
||||
def test_ttm_trend(self):
|
||||
def test_ttm_trend(self):
|
||||
result = pandas_ta.ttm_trend(self.high, self.low, self.close)
|
||||
self.assertIsInstance(result, DataFrame)
|
||||
self.assertEqual(result.name, "TTMTREND_6")
|
||||
|
||||
@@ -98,7 +98,7 @@ class TestTrendExtension(TestCase):
|
||||
self.assertIsInstance(self.data, DataFrame)
|
||||
self.assertEqual(self.data.columns[-1], "SR_2")
|
||||
|
||||
def test_ttm_trend_ext(self):
|
||||
def test_ttm_trend_ext(self):
|
||||
self.data.ta.ttm_trend(append=True)
|
||||
self.assertIsInstance(self.data, DataFrame)
|
||||
self.assertEqual(list(self.data.columns[-1:]), ["TTM_TRND_6"])
|
||||
|
||||
Reference in New Issue
Block a user