code: def update_holder(self, holder):
          subject_symbol = self.subject.symbol
          if subject_symbol in holder.state:
              if not holder.state[subject_symbol]['quantity']:
                  holder.state[subject_symbol]['value'] = self.details['value']
              elif same_sign(
                      holder.state[subject_symbol]['quantity'],
                      self.details['quantity']):
                  holder.state[subject_symbol]['value'] = average_price(
                      holder.state[subject_symbol]['quantity'],
                      holder.state[subject_symbol]['value'],
                      self.details['quantity'],
                      self.details['value']
                  )
              else:
                  if same_sign(
                          self.details['quantity'],
                          holder.state[subject_symbol]['quantity'] + self.details['quantity']):
                      holder.state[subject_symbol]['value'] = self.details['value']
              holder.state[subject_symbol]['quantity'] += self.details['quantity']
          else:
              holder.state[subject_symbol] = {
                  'quantity': self.details['quantity'],
                  'value': self.details['value']
              }
          if not holder.state[subject_symbol]['quantity']:
              holder.state[subject_symbol]['value'] = 0