self.get_last_prices¶
- strategies.strategy.Strategy.get_last_prices(self, assets)¶
Takes a list of assets and returns the last known prices
Makes an active call to the market to retrieve the last price. In backtesting will provide the close of the last complete bar.
- Parameters
assets (list of Asset objects) – List of Asset objects for which the last closed price will be retrieved.
- Returns
Last known closing prices.
- Return type
list of floats
Example
>>> # Will return the last price for the assets >>> assets = ["SPY", "TLT"] >>> last_prices = self.get_last_prices(assets)