def testTRIMA(self): barDs = self.__loadBarDS() self.assertAmountsAreEqual( indicator.TRIMA(barDs.getCloseDataSeries(), 252, 10)[9], 93.6043) self.assertAmountsAreEqual( indicator.TRIMA(barDs.getCloseDataSeries(), 252, 10)[10], 93.4252) self.assertAmountsAreEqual( indicator.TRIMA(barDs.getCloseDataSeries(), 252, 10)[-2], 109.1850, 3) self.assertAmountsAreEqual( indicator.TRIMA(barDs.getCloseDataSeries(), 252, 10)[-1], 109.1407)
def testTRIMA(self): barDs = self.__loadBarDS() self.assertTrue( compare( indicator.TRIMA(barDs.getCloseDataSeries(), 252, 10)[9], 93.6043)) self.assertTrue( compare( indicator.TRIMA(barDs.getCloseDataSeries(), 252, 10)[10], 93.4252)) self.assertTrue( compare( indicator.TRIMA(barDs.getCloseDataSeries(), 252, 10)[-2], 109.1850, 3)) self.assertTrue( compare( indicator.TRIMA(barDs.getCloseDataSeries(), 252, 10)[-1], 109.1407))