def testAPO(self):
     barDs = self.__loadBarDS()
     self.assertAmountsAreEqual(
         indicator.APO(barDs.getCloseDataSeries(), 252, 26, 12,
                       talib.MA_Type.SMA)[25], -3.3124)
     self.assertAmountsAreEqual(
         indicator.APO(barDs.getCloseDataSeries(), 252, 12, 26,
                       talib.MA_Type.SMA)[25], -3.3124)
     self.assertAmountsAreEqual(
         indicator.APO(barDs.getCloseDataSeries(), 252, 12, 26,
                       talib.MA_Type.SMA)[26], -3.5876)
     self.assertAmountsAreEqual(
         indicator.APO(barDs.getCloseDataSeries(), 252, 12, 26,
                       talib.MA_Type.SMA)[-1], -0.1667)
Exemple #2
0
 def testAPO(self):
     barDs = self.__loadBarDS()
     self.assertTrue(
         compare(
             indicator.APO(barDs.getCloseDataSeries(), 252, 26, 12,
                           talib.MA_Type.SMA)[25], -3.3124))
     self.assertTrue(
         compare(
             indicator.APO(barDs.getCloseDataSeries(), 252, 12, 26,
                           talib.MA_Type.SMA)[25], -3.3124))
     self.assertTrue(
         compare(
             indicator.APO(barDs.getCloseDataSeries(), 252, 12, 26,
                           talib.MA_Type.SMA)[26], -3.5876))
     self.assertTrue(
         compare(
             indicator.APO(barDs.getCloseDataSeries(), 252, 12, 26,
                           talib.MA_Type.SMA)[-1], -0.1667))