Exemplo n.º 1
0
 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)
Exemplo n.º 2
0
 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))