def testMACDEXT(self): barDs = self.__loadBarDS() self.assertAmountsAreEqual( indicator.MACDEXT(barDs.getCloseDataSeries(), 252, 12, talib.MA_Type.EMA, 26, talib.MA_Type.EMA, 9, talib.MA_Type.EMA)[0][33], -1.9738) self.assertAmountsAreEqual( indicator.MACDEXT(barDs.getCloseDataSeries(), 252, 12, talib.MA_Type.EMA, 26, talib.MA_Type.EMA, 9, talib.MA_Type.EMA)[1][33], -2.7071) self.assertAmountsAreEqual( indicator.MACDEXT(barDs.getCloseDataSeries(), 252, 12, talib.MA_Type.EMA, 26, talib.MA_Type.EMA, 9, talib.MA_Type.EMA)[2][33], (-1.9738) - (-2.7071))
def testMACDEXT(self): barDs = self.__loadBarDS() self.assertTrue( compare( indicator.MACDEXT(barDs.getCloseDataSeries(), 252, 12, talib.MA_EMA, 26, talib.MA_EMA, 9, talib.MA_EMA)[0][33], -1.9738)) self.assertTrue( compare( indicator.MACDEXT(barDs.getCloseDataSeries(), 252, 12, talib.MA_EMA, 26, talib.MA_EMA, 9, talib.MA_EMA)[1][33], -2.7071)) self.assertTrue( compare( indicator.MACDEXT(barDs.getCloseDataSeries(), 252, 12, talib.MA_EMA, 26, talib.MA_EMA, 9, talib.MA_EMA)[2][33], (-1.9738) - (-2.7071)))