self.get_realtime_bars

lumibot.strategies.strategy.Strategy.get_realtime_bars(self, asset)

Retrieve the real time bars as dataframe.

Returns the current set of real time bars as a dataframe. The datetime will be in the index. The columns of the dataframe are:

  • open

  • high

  • low

  • close

  • volume

  • vwap

  • count (trade count)

Parameters:

asset (Asset object) – The asset that has a stream active.

Returns:

dataframe – Dataframe containing the most recent pricing information for the asset. The data returned will be the datetime in the index and the following columns.

  • open

  • high

  • low

  • close

  • volume

  • vwap

  • count (trade count)

The length of the dataframe will have been set the intial start of the real time bars.

Return type:

Pandas Dataframe.