Пример #1
0
 def testWMA(self):
     barDs = self.__loadBarDS()
     self.assertAmountsAreEqual(
         indicator.WMA(barDs.getCloseDataSeries(), 252, 2)[1], 93.71)
     self.assertAmountsAreEqual(
         indicator.WMA(barDs.getCloseDataSeries(), 252, 2)[2], 94.52)
     self.assertAmountsAreEqual(
         indicator.WMA(barDs.getCloseDataSeries(), 252, 2)[3],
         94.86)  # Original value 94.85
     self.assertAmountsAreEqual(
         indicator.WMA(barDs.getCloseDataSeries(), 252, 2)[-1], 108.16)
Пример #2
0
 def testWMA(self):
     barDs = self.__loadBarDS()
     self.assertTrue(
         compare(
             indicator.WMA(barDs.getCloseDataSeries(), 252, 2)[1], 93.71))
     self.assertTrue(
         compare(
             indicator.WMA(barDs.getCloseDataSeries(), 252, 2)[2], 94.52))
     self.assertTrue(
         compare(
             indicator.WMA(barDs.getCloseDataSeries(), 252, 2)[3],
             94.86))  # Original value 94.85
     self.assertTrue(
         compare(
             indicator.WMA(barDs.getCloseDataSeries(), 252, 2)[-1], 108.16))