def testROC(self): barDs = self.__loadBarDS() self.assertAmountsAreEqual( indicator.ROC(barDs.getCloseDataSeries(), 252, 14)[14], -0.546) self.assertAmountsAreEqual( indicator.ROC(barDs.getCloseDataSeries(), 252, 14)[15], -2.109) self.assertAmountsAreEqual( indicator.ROC(barDs.getCloseDataSeries(), 252, 14)[16], -5.53) self.assertAmountsAreEqual( indicator.ROC(barDs.getCloseDataSeries(), 252, 14)[-1], -1.0367)
def testROC(self): barDs = self.__loadBarDS() self.assertTrue( compare( indicator.ROC(barDs.getCloseDataSeries(), 252, 14)[14], -0.546)) self.assertTrue( compare( indicator.ROC(barDs.getCloseDataSeries(), 252, 14)[15], -2.109)) self.assertTrue( compare( indicator.ROC(barDs.getCloseDataSeries(), 252, 14)[16], -5.53)) self.assertTrue( compare( indicator.ROC(barDs.getCloseDataSeries(), 252, 14)[-1], -1.0367))