QuantRocket 2.5.0 is now available. This release introduces support for custom data, real-time data from Alpaca, multi-account support for Alpaca, an update to IB Gateway, and other enhancements. All version 2 users are encouraged to update to the latest version. See how to update.
- Load custom data in a history database then query it using QuantRocket’s standard APIs. See the usage guide.
- Real-time data from Alpaca. See the usage guide.
- Connect to multiple live and/or paper Alpaca accounts. See the usage guide.
- Update to IB Gateway version 981. See the note below.
IB Gateway Version Update
This release updates the installed version of IB Gateway to version 981, the current latest version from Interactive Brokers. This version of IB Gateway includes a new daily auto-restart feature which runs at 11:45 PM New York time, and which users should be aware of. With this feature, users with two-factor authentication enabled will only need to manually re-authenticate once a week, on Sundays. The new auto-restart feature also renders unnecessary the recommendation given in previous versions of QuantRocket to restart IB Gateway daily via the countdown service crontab. Learn more about auto-restart.
In addition, users with two-factor authentication no longer need to manually update IB Gateway settings after logging in. QuantRocket will now adjust settings automatically regardless of whether two-factor authentication is used.
- Starting with this version, images (other than the
quantrocket/ziplineimage) are based on the Miniconda distribution instead of the full Anaconda distribution. Core data science packages are still installed in containers. However, it is possible that a particular Python package that was included in the full Anaconda distribution and was utilized by custom user code is no longer installed. If this happens, please install the package as needed in a satellite container.
- The main Python 3 environment has been updated from Python 3.7 to Python 3.8 and from pandas 1.0 to pandas 1.2. (This does not apply to the Zipline environment or container.)
Complete 2.5.0 release notes
- collect balances and portfolios from multiple Alpaca accounts, if connected
- support for multiple Alpaca accounts. Orders are routed to the proper API connection based on the account number.
- fix errors that resulted from Alpaca switching from alphanumeric to numeric account numbers for live accounts. See related forum post.
- add new utility functions in the
quantrocket.dbmodule for inserting custom data into a database. See the usage guide.
- add new function
quantrocket.get_prices_reindexed_like. Primarily intended for use with custom data, this function can query any database queryable with
get_pricesand return the data in the same shape as an input DataFrame. See the usage guide.
- fix an issue where querying multiple databases failed if any of the databases returned no data. See related forum post.
- add support for creating custom databases. See the usage guide.
- add a
quantrocket history create-usstock-db/
quantrocket.history.create_usstock_dbfor requesting free sample data. This parameter, which mirrors a similar parameter in
quantrocket.zipline.create_usstock_bundle, is now the preferred parameter for requesting free sample data. The previously used parameter,
universe="FREE", is still available but is deprecated and will print a deprecation warning.
- update to IB Gateway version 981. See the fuller note above.
- pyfolio update: treat short positions in Moonshot results as reducing cash in pyfolio tear sheets. See related forum post.
- add a parameter for specifying your Alpaca data permission when entering your API key. See the usage guide.
- when collecting listings from Interactive Brokers, and IB Gateway is not running, the master service will now wait for IB Gateway to start, instead of failing immediately as in previous versions. This mirrors the existing behavior of the history and fundamental services when collecting data from Interactive Brokers. This change does not apply to data collection for options, which will still fail immediately if IB Gateway is not running.
- add support for combining a mix of intraday and daily strategies in the same backtest. See related forum post.
- update to TimescaleDB version 2.1.0
- add support for collecting real-time data from Alpaca. See the usage guide.
- return output from custom Python functions accessed using dot notation. See the usage guide.
- add support for loading custom databases into Pipeline. See the usage guide.
- automatically send GTC (Good-till-canceled) orders in live trading if the algorithm’s cancel policy is set to
NeverCancel. See the usage guide.
- in live trading, if querying a real-time database based on native minute aggregates (which is the recommended approach for Alpaca real-time databases), Zipline will query the real-time database repeatedly until all of the minute data has arrived. Zipline monitors for two successive queries to return the same number of records as an indication that all minute data has arrived. This design avoids a potential race condition where Zipline might query for minute data before the minute data has fully arrived from the data provider.
- fix an issue where backtests using the US stock minute bundle failed with a segmentation fault or other C error if the backtest spanned a particular date in May 2020 and utilized certain Zipline API functions. See related forum post.
- fix an issue where querying daily data in Zipline live trading using
data.history(... '1d')caused an error if real-time data collection was initiated before the market opened.
- fix an issue where NULL order statuses in live trading (meaning the broker has not yet sent an order status) caused Zipline to fail with an unhandled exception. See related forum post.