예제 #1
0
 def testVAR(self):
     barDs = self.__loadBarDS()
     self.assertAmountsAreEqual(
         indicator.VAR(barDs.getCloseDataSeries(), 252, 5.0, 1)[4],
         1.2856**2)
     self.assertAmountsAreEqual(
         indicator.VAR(barDs.getCloseDataSeries(), 252, 5.0, 1)[5],
         0.4462**2)
     self.assertAmountsAreEqual(
         indicator.VAR(barDs.getCloseDataSeries(), 252, 5.0, 1)[-1],
         0.7144**2)
예제 #2
0
 def testVAR(self):
     barDs = self.__loadBarDS()
     self.assertTrue(
         compare(
             indicator.VAR(barDs.getCloseDataSeries(), 252, 5.0, 1)[4],
             1.2856**2))
     self.assertTrue(
         compare(
             indicator.VAR(barDs.getCloseDataSeries(), 252, 5.0, 1)[5],
             0.4462**2))
     self.assertTrue(
         compare(
             indicator.VAR(barDs.getCloseDataSeries(), 252, 5.0, 1)[-1],
             0.7144**2))