def testSTDDEV(self): barDs = self.__loadBarDS() self.assertTrue( compare( indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1)[4], 1.2856)) self.assertTrue( compare( indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1)[5], 0.4462)) self.assertTrue( compare( indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1)[-1], 0.7144)) self.assertTrue( compare( indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1.5)[4], 1.9285)) self.assertTrue( compare( indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1.5)[5], 0.66937)) self.assertTrue( compare( indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1.5)[-1], 1.075))
def testSTDDEV(self): barDs = self.__loadBarDS() self.assertAmountsAreEqual(indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1)[4], 1.2856) self.assertAmountsAreEqual(indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1)[5], 0.4462) self.assertAmountsAreEqual(indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1)[-1], 0.7144) self.assertAmountsAreEqual(indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1.5)[4], 1.9285) self.assertAmountsAreEqual(indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1.5)[5], 0.66937) self.assertAmountsAreEqual(indicator.STDDEV(barDs.getCloseDataSeries(), 252, 5.0, 1.5)[-1], 1.075)