code: def testStockChartsBollinger_Bounded(self):
      # Test data from http://stockcharts.com/school/doku.php?id=chart_school:technical_indicators:bollinger_bands
      prices = [
          86.1557,
          89.0867,
          88.7829,
          90.3228,
          89.0671,
          91.1453,
          89.4397,
          89.1750,
          86.9302,
          87.6752,
          86.9596,
          89.4299,
          89.3221,
          88.7241,
          87.4497,
          87.2634,
          89.4985,
          87.9006,
          89.1260,
          90.7043,
          92.9001,
          92.9784,
          91.8021,
          92.6647,
          92.6843,
          92.3021,
          92.7725,
          92.5373,
          92.9490,
          93.2039,
          91.0669,
          89.8318,
          89.7435,
          90.3994,
          90.7387,
          88.0177,
          88.0867,
          88.8439,
          90.7781,
          90.5416,
          91.3894,
          90.6500,
      ]
      expectedMiddle = [91.24, 91.17, 91.05]
      expectedUpper = [94.53, 94.37, 94.15]
      expectedLower = [87.95, 87.96, 87.95]
  
      seqDS = dataseries.SequenceDataSeries()
      bBands = bollinger.BollingerBands(seqDS, 20, 2, 3)
      for value in prices:
          seqDS.append(value)
  
      for i in xrange(3):
          self.assertEqual(
              round(bBands.getMiddleBand()[i], 2), expectedMiddle[i]
          )
          self.assertEqual(
              round(bBands.getUpperBand()[i], 2), expectedUpper[i]
          )
          self.assertEqual(
              round(bBands.getLowerBand()[i], 2), expectedLower[i]
          )
  
      self.assertEqual(len(bBands.getMiddleBand()), 3)
      self.assertEqual(len(bBands.getMiddleBand()[:]), 3)
      self.assertEqual(len(bBands.getMiddleBand().getDateTimes()), 3)
      self.assertEqual(len(bBands.getUpperBand()), 3)
      self.assertEqual(len(bBands.getUpperBand()[:]), 3)
      self.assertEqual(len(bBands.getUpperBand().getDateTimes()), 3)
      self.assertEqual(len(bBands.getLowerBand()), 3)
      self.assertEqual(len(bBands.getLowerBand()[:]), 3)
      self.assertEqual(len(bBands.getLowerBand().getDateTimes()), 3)
  
imports: from six.moves import xrange
  from .None import common
  from pyalgotrade.technical import bollinger
  from pyalgotrade import dataseries
label_desc: Use image node_id 2 for calling the TestCase obj's underlying member method code with example usage: obj.testStockChartsBollinger_Bounded() without return types