vnpy/trader/krutility.py
def update_bar(self, bar):
        """
        Update new bar data into array manager.
        """
        self.count += 1
        if not self.inited and self.count >= self.size:
            self.inited = True

        self.datetime_array[:-1] = self.datetime_array[1:]
        self.open_array[:-1] = self.open_array[1:]
        self.high_array[:-1] = self.high_array[1:]
        self.low_array[:-1] = self.low_array[1:]
        self.close_array[:-1] = self.close_array[1:]
        self.volume_array[:-1] = self.volume_array[1:]

        self.datetime_array[-1] = bar.datetime
        self.open_array[-1] = bar.open_price
        self.high_array[-1] = bar.high_price
        self.low_array[-1] = bar.low_price
        self.close_array[-1] = bar.close_price
        self.volume_array[-1] = bar.volume

        Update new bar data into array manager.
        
Update new bar data into array manager.
Update new bar data into array manager .
def update_bar(self, bar):
        self.count += 1
        if not self.inited and self.count >= self.size:
            self.inited = True
        self.datetime_array[:-1] = self.datetime_array[1:]
        self.open_array[:-1] = self.open_array[1:]
        self.high_array[:-1] = self.high_array[1:]
        self.low_array[:-1] = self.low_array[1:]
        self.close_array[:-1] = self.close_array[1:]
        self.volume_array[:-1] = self.volume_array[1:]
        self.datetime_array[-1] = bar.datetime
        self.open_array[-1] = bar.open_price
        self.high_array[-1] = bar.high_price
        self.low_array[-1] = bar.low_price
        self.close_array[-1] = bar.close_price
        self.volume_array[-1] = bar.volume
def update_bar ( self , bar ) : self . count += 1 if not self . inited and self . count >= self . size : self . inited = True self . datetime_array [ : - 1 ] = self . datetime_array [ 1 : ] self . open_array [ : - 1 ] = self . open_array [ 1 : ] self . high_array [ : - 1 ] = self . high_array [ 1 : ] self . low_array [ : - 1 ] = self . low_array [ 1 : ] self . close_array [ : - 1 ] = self . close_array [ 1 : ] self . volume_array [ : - 1 ] = self . volume_array [ 1 : ] self . datetime_array [ - 1 ] = bar . datetime self . open_array [ - 1 ] = bar . open_price self . high_array [ - 1 ] = bar . high_price self . low_array [ - 1 ] = bar . low_price self . close_array [ - 1 ] = bar . close_price self . volume_array [ - 1 ] = bar . volume
Update new bar data into array manager.
Update new bar data into array manager .
"""
        Update new bar data into array manager.
        """
self
bar