code: def buy(self, no, price, value):
      ''' 買 '''
      self.money += -price*value
      try:
        self.store[no] += value
      except:
        self.store[no] = value
      try:
        self.avgprice[no]['buy'] += [price]
      except:
        try:
          self.avgprice[no]['buy'] = [price]
        except:
          self.avgprice[no] = {}
          self.avgprice[no]['buy'] = [pricef buy(self, no, price, value):
      ''' 買 '''
      self.money += -price*value
      try:
        self.store[no] += value
      except:
        self.store[no] = value
      try:
        self.avgprice[no]['buy'] += [price]
      except:
        try:
          self.avgprice[no]['buy'] = [price]
        except:
          self.avgprice[no] = {}
          self.avgprice[no]['buy'] = [price]
docs: 買