Example #1
0
 def testRSI_Bounded(self):
     values = [44.3389, 44.0902, 44.1497, 43.6124, 44.3278, 44.8264, 45.0955, 45.4245, 45.8433, 46.0826, 45.8931, 46.0328, 45.6140, 46.2820, 46.2820]
     rsi = self.__buildRSI(values, 14, 1)
     self.assertEqual(round(rsi[0], 8), 70.53278948)
     self.assertEqual(len(rsi), 1)
     self.assertEqual(len(rsi[:]), 1)
     self.assertEqual(len(rsi.getDateTimes()), 1)
     self.assertEqual(round(rsi[-1], 8), 70.53278948)
Example #2
0
    def testDateTimes(self):
        rsi = self.__buildRSI(range(10), 3)

        self.assertEqual(len(rsi.getDateTimes()), 10)
        for i in range(len(rsi)):
            self.assertEqual(rsi.getDateTimes()[i], None)