The history() function has been extended and now supports trailing windows of one minute granularity. This was a popular request and we’re excited to expand the feature.
As a reminder, history() is a function that returns price and volume information for a trailing window of data. Before today, we only supported day-level, or ‘1d’ values. Now, we support '1m' values. The remaining syntax is the same.
This feature now enables a number of ideas to be easily implemented. For instance, you can create a vwap, or moving average, or other transform on much shorter time frames using minute bars. You can also inspect the minutes before market close or after the open, if that interests you.
For example the code below returns the last 20 minutes of the stock price as a pandas dataframe:
history(20, ‘1m’, ‘price’)
This is one step closer to deprecating batch_transform(). If you're using batch_transform to generate trailing windows in minute mode, you should consider changing the code over to history().
The attached example compares the 90 minute VWAP to the 30 minute VWAP for a stock. Happy coding!