def testCORREL(self):
     barDs = self.__loadBarDS()
     self.assertAmountsAreEqual(
         indicator.CORREL(barDs.getHighDataSeries(),
                          barDs.getLowDataSeries(), 252, 20)[19], 0.9401569)
     self.assertAmountsAreEqual(
         indicator.CORREL(barDs.getHighDataSeries(),
                          barDs.getLowDataSeries(), 252, 20)[20], 0.9471812)
     self.assertAmountsAreEqual(
         indicator.CORREL(barDs.getHighDataSeries(),
                          barDs.getLowDataSeries(), 252, 20)[-1], 0.8866901)
Example #2
0
 def testCORREL(self):
     barDs = self.__loadBarDS()
     self.assertTrue(
         compare(
             indicator.CORREL(barDs.getHighDataSeries(),
                              barDs.getLowDataSeries(), 252, 20)[19],
             0.9401569))
     self.assertTrue(
         compare(
             indicator.CORREL(barDs.getHighDataSeries(),
                              barDs.getLowDataSeries(), 252, 20)[20],
             0.9471812))
     self.assertTrue(
         compare(
             indicator.CORREL(barDs.getHighDataSeries(),
                              barDs.getLowDataSeries(), 252, 20)[-1],
             0.8866901))