def update(self, date, data=None, inow=None):
        """
        Update security with a given date and optionally, some data.
        This will update price, value, weight, etc.
        """
        # filter for internal calls when position has not changed - nothing to
        # do. Internal calls (stale root calls) have None data. Also want to
        # make sure date has not changed, because then we do indeed want to
        # update.
        if date == self.now and self._last_pos == self._position:
            return

        if inow is None:
            if date == 0:
                inow = 0
            else:
                inow = self.data.index.get_loc(date)

        # date change - update price
        if date != self.now:
            # update now
            self.now = date

            if self._prices_set:
                self._price = self._prices.values[inow]
            # traditional data update
            elif data is not None:
                prc = data[self.name]
                self._price = prc
                self._prices.values[inow] = prc

        self._positions.values[inow] = self._position
        self._last_pos = self._position

        if np.isnan(self._price):
            if self._position == 0:
                self._value = 0
            else:
                raise Exception(
                    'Position is open (non-zero) and latest price is NaN '
                    'for security %s. Cannot update node value.' % self.name)
        else:
            self._value = self._position * self._price * self.multiplier

        self._values.values[inow] = self._value

        if self._weight == 0 and self._position == 0:
            self._needupdate = False

        # save outlay to outlays
        if self._outlay != 0:
            self._outlays.values[inow] = self._outlay
            # reset outlay back to 0
            self._outlay = 0
Update security with a given date and optionally, some data.
        This will update price, value, weight, etc.