The BlueShift literature suggests that "last" price is available: This method returns the current (latest available) price data for the specified assets. Args: ``assets(list)``: A list of assets to fetch data for. ``fields(list)``: A list of fields to fetch data for Allowed fields are in [`open`, `high`, `low`, `close`, `volume`, `last`]. Returns: A float in case of a single asset and field, a Pandas data ``Series`` in case of either multiple asset and single field (keyed by assets) or single assets and multiple field (keyed by fields). For both multiple assets and fields a Pandas ``DataFrame`` will be returned. When I run the follwoing snippet I get an error that "last" is not in the data store. THe other fields int he literature are available. def initialize(context): context.universe = [symbol("AAPL"), symbol("MSFT")] def handle_data(context, data): cpx1 = data.current(context.universe[0], "last") Am I doign something wrong? or is "last" not available?
Thanks for pointing this out Rory. It seems our documentation needs an update. We no longer support the "last" field, please replace "last" with "close".
"last" and "close" are two very different fields. You cannot replace "last" with "close". Is there a way to fetch the last executed price?
On Blueshift, close price for a minute query (e.g. data.current, or data.history with '1m') fetches closing price (the last available price) for the current (data.current) or applicable (data.history) minute bar(s). On backtest, this is the last traded price of that (those) minute bar(s). On live trading, depending on the broker streaming data, this is either the last available traded price, or last available quote update (upto the instant of query). Close price for a daily query (data.history with '1d') it is the last traded price of the day. Blueshift does not provide the "official close" price (which is applicable only for daily frequency btw). If you are looking for something else, please explain the details here.
Thank you!! That is very helpful!
And sorry for the curt tone of my first response. I was half asleep when I wrote it. Haha. Just re-read it this am and was embarressed.
Thank you!