Пример #1
0
 def testPPO(self):
     barDs = self.__loadBarDS()
     self.assertAmountsAreEqual(
         indicator.PPO(barDs.getCloseDataSeries(), 252, 2, 3,
                       talib.MA_Type.SMA)[2], 1.10264)
     self.assertAmountsAreEqual(
         indicator.PPO(barDs.getCloseDataSeries(), 252, 2, 3,
                       talib.MA_Type.SMA)[3], -0.02813)
     self.assertAmountsAreEqual(
         indicator.PPO(barDs.getCloseDataSeries(), 252, 2, 3,
                       talib.MA_Type.SMA)[-1], -0.21191)
Пример #2
0
 def testPPO(self):
     barDs = self.__loadBarDS()
     self.assertTrue(
         compare(
             indicator.PPO(barDs.getCloseDataSeries(), 252, 2, 3,
                           talib.MA_Type.SMA)[2], 1.10264))
     self.assertTrue(
         compare(
             indicator.PPO(barDs.getCloseDataSeries(), 252, 2, 3,
                           talib.MA_Type.SMA)[3], -0.02813))
     self.assertTrue(
         compare(
             indicator.PPO(barDs.getCloseDataSeries(), 252, 2, 3,
                           talib.MA_Type.SMA)[-1], -0.21191))