add-ttm-trend

This commit is contained in:
alexonab
2020-08-28 23:33:02 -04:00
parent e2dd45a678
commit cb57bd5e2a
3 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -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")
+1 -1
View File
@@ -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")
+1 -1
View File
@@ -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"])