QuantRocket 2.5.0 Release Notes

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.

Highlights

  • 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.

Library updates

  • Starting with this version, images (other than the quantrocket/zipline image) 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

quantrocket/account: 2.5.0

  • collect balances and portfolios from multiple Alpaca accounts, if connected

quantrocket/blotter:2.5.0

  • 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.

quantrocket-client:2.5.0

  • add new utility functions in the quantrocket.db module 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_prices and 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.

quantrocket/history:2.5.0

  • add support for creating custom databases. See the usage guide.
  • add a free parameter to quantrocket history create-usstock-db/quantrocket.history.create_usstock_db for 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.

quantrocket/ibg:2.5.981.0

  • update to IB Gateway version 981. See the fuller note above.

quantrocket/jupyter:2.5.0

  • pyfolio update: treat short positions in Moonshot results as reducing cash in pyfolio tear sheets. See related forum post.

quantrocket/license-service:2.5.0

  • add a parameter for specifying your Alpaca data permission when entering your API key. See the usage guide.

quantrocket/master:2.5.0

  • 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.

quantrocket/moonshot:2.5.0

  • add support for combining a mix of intraday and daily strategies in the same backtest. See related forum post.

quantrocket/postgres:2.5.0

  • update to TimescaleDB version 2.1.0

quantrocket/realtime:2.5.0

  • add support for collecting real-time data from Alpaca. See the usage guide.

quantrocket/satellite:2.5.0

  • return output from custom Python functions accessed using dot notation. See the usage guide.

quantrocket/zipline:2.5.0

  • 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.

Oh man, this is a sick update! Really appreciate the custom data and Alpaca realtime data updates. Thanks mate!

One question; any chance custom data will eventually support sharding similar to how it's supported elsewhere in QuantRocket?

We'll see. Iā€™d like to see how things go with the non-sharded design first.

Are Alpaca's fractional shares included in this update?

I assumed Alpaca was just offering Polygon through their UI, but some people on Alpaca's forums are reporting 20% less coverage than Polygon. @Brian have you seen tests that confirm/deny this?
image


Seems like we'd have to pay $199/month at Polygon for (almost) the same data as Alpaca's at $50/month. Haven't seen anyone from Alpaca state the exact differences yet. Please post if you hear.

Biggest difference I noticed is that they're still in the process of backfilling historic data; they actually don't have a ton completed yet... Seems very much still in progress; see below.

1 Like

It seems like the a potential hypothesis is that Polygon contains dark-pools whereas Alpaca Pro may not. Haven't heard if cancellations & before/after-hours data in Pro is equivalent to Polygon either.