QuantRocket 2.4.0 is now available. This release includes a number of enhancements related to real-time data, the US Stock dataset, and feature parity with Quantopian. All version 2 users are encouraged to update to the latest version. See how to update.
Highlights
- There are two new additions to the Code Library:
- Quant Finance Lectures. This is the Quantopian Lecture Series updated for QuantRocket.
- Pipeline tutorial. This tutorial provides an in-depth walkthrough of the Pipeline API.
- It is now possible to collect real-time data for large universes, such as the entire US stock market, by collecting minute or second aggregate data from Polygon.io instead of full tick data. See the usage guide and the updated configuration guidance for using Polygon.io data with Zipline.
- There are several new securities master fields for the US Stock dataset:
- Sector and Industry. See an example record in the usage guide.
- Primary share. A new field distinguishes primary from secondary share classes for companies with multiple share classes. See the usage guide.
- You can now query daily data from a minute bundle using the new
data_frequency
parameter onquantrocket.get_prices
andquantrocket.zipline.download_bundle_file
. See the usage guide. - Users who don't want to collect the full US Stock minute bundle can ingest only the daily portion of the bundle for use in Zipline, the Pipeline API, and throughout QuantRocket. See the usage guide for a comparison of the different ways to access the US Stock dataset.
- There are two Python API enhancements for the securities master service:
- a new convenience function,
quantrocket.master.get_securities
, queries the securities master database and loads the results into a DataFrame. (Previously, downloading the master file and loading it into a DataFrame were two separate steps.) See the API Reference. - The function
quantrocket.master.create_universe
now accepts asids
parameter that makes it easier to create a universe from a DataFrame without having to write the DataFrame to a CSV. See the API Reference for an example.
- a new convenience function,
Documentation
- A new section of the usage guide documents how to replicate the
QTradableStocksUS
universe, a popular Pipeline filter on Quantopian. - A detailed note has been added to the docstring for
quantrocket.master.download_master_file
andquantrocket.master.get_securities
explaining how multiple parameters are combined when querying the securities master. See the API Reference. - A note has been added to usage guide mentioning that
print
statements will show up in the detailed logs.
API Changes
- the function
quantrocket.zipline.download_minute_file
has been renameddownload_bundle_file
since it can now be used to download minute or daily data, using the newdata_frequency
parameter. The old function is still available but will print a deprecation warning.
Sample Data
- SPY is now included in the free sample data
Complete 2.4.0 release notes
quantrocket/blotter:2.4.0
- reduce memory usage in PNL calculation when there is a large number of executions
quantrocket/flightlog:2.4.0
- make
quantrocket.flightlog.FlightlogHandler
a singleton to prevent users from unintentionally logging duplicate messages in their code
quantrocket/fundamental:2.4.0
- better error handling when the IBKR API returns invalid XML indicating no Reuters estimates data is available
quantrocket/master:2.4.0
- add Sector and Industry fields to US Stock dataset. See an example record in the usage guide.
- add a field to distinguish primary vs secondary share class in the US Stock dataset. See the usage guide.
- add a new convenience function
quantrocket.master.get_securities
, which queries the securities master database and loads the results into a DataFrame. (Previously, downloading the master file and loading it into a DataFrame were two separate steps.) See the API Reference. - add a
sids
parameter toquantrocket.master.create_universe
to make it easier to create a universe from a DataFrame without having to write the DataFrame to a CSV. See the API Reference for an example.
quantrocket/moonshot:2.4.0
- add new paramater
DB_DATA_FREQUENCY
which can used for querying daily data from a Zipline minute bundle. See the API Reference.
quantrocket/postgres:2.4.0
- changes the default PostgreSQL log level in order to silence the excessively noisy TimescaleDB logging related to aggregate databases seen in previous versions
quantrocket/realtime:2.4.0
- add support for collecting Polygon.io minute or second aggregates, which facilitates real-time data collection for large universes. See the usage guide, the updated note on database performance, and the updated configuration guidance for using Polygon.io data with Zipline.
quantrocket/zipline:2.4.0
- support for querying daily data from a minute bundle using the new
data_frequency
parameter onquantrocket.get_prices
andquantrocket.zipline.download_bundle_file
. See the usage guide. - support for ingesting only the daily portion of the US Stock minute bundle. This is provided as a convenience for users who don't want to collect the full minute bundle. See the usage guide for a comparison of the different ways to access the US Stock dataset.
- add new US Stock master fields (
usstock_Sector
,usstock_Industry
,usstock_PrimaryShareSid
, andusstock_CIK
) toSecuritiesMaster
Pipeline dataset - roll-up real-time minute data in live trading to support queries for partial day daily data using
data.hist(... '1d')
. See related forum post.
quantrocket_trading_calendars:2.4.0
- add a trading calendar for US extended hours which runs from 4 AM to 8 PM:
us_extended_hours
. This can be used when querying trading hours from themaster
service or when ingesting a history database with extended hours data into Zipline.