center of gravity indicator added

This commit is contained in:
Kevin Johnson
2019-05-26 15:40:07 -07:00
parent 6349df39a6
commit c4a2fb99b2
7 changed files with 79 additions and 2 deletions
+5
View File
@@ -84,6 +84,11 @@ class TestMomentum(TestCase):
except Exception as ex:
error_analysis(result, CORRELATION, ex)
def test_cg(self):
result = pandas_ta.cg(self.close)
self.assertIsInstance(result, Series)
self.assertEqual(result.name, 'CG_10')
def test_cmo(self):
result = pandas_ta.cmo(self.close)
self.assertIsInstance(result, Series)
+5
View File
@@ -43,6 +43,11 @@ class TestMomentumExtension(TestCase):
self.assertIsInstance(self.data, DataFrame)
self.assertEqual(self.data.columns[-1], 'CCI_20_0.015')
def test_cg_ext(self):
self.data.ta.cg(append=True)
self.assertIsInstance(self.data, DataFrame)
self.assertEqual(self.data.columns[-1], 'CG_10')
def test_cmo_ext(self):
self.data.ta.cmo(append=True)
self.assertIsInstance(self.data, DataFrame)