def testROCR(self):
     barDs = self.__loadBarDS()
     self.assertAmountsAreEqual(
         indicator.ROCR(barDs.getCloseDataSeries(), 252, 14)[14], 0.994536,
         4)
     self.assertAmountsAreEqual(
         indicator.ROCR(barDs.getCloseDataSeries(), 252, 14)[15], 0.978906,
         4)
     self.assertAmountsAreEqual(
         indicator.ROCR(barDs.getCloseDataSeries(), 252, 14)[16], 0.944689,
         4)
     self.assertAmountsAreEqual(
         indicator.ROCR(barDs.getCloseDataSeries(), 252, 14)[-1], 0.989633,
         4)
Exemple #2
0
 def testROCR(self):
     barDs = self.__loadBarDS()
     self.assertTrue(
         compare(
             indicator.ROCR(barDs.getCloseDataSeries(), 252, 14)[14],
             0.994536, 4))
     self.assertTrue(
         compare(
             indicator.ROCR(barDs.getCloseDataSeries(), 252, 14)[15],
             0.978906, 4))
     self.assertTrue(
         compare(
             indicator.ROCR(barDs.getCloseDataSeries(), 252, 14)[16],
             0.944689, 4))
     self.assertTrue(
         compare(
             indicator.ROCR(barDs.getCloseDataSeries(), 252, 14)[-1],
             0.989633, 4))