QuantRocket version 2 is a major product upgrade from version 1, with many new features and additional data and brokers. Due to the scale of changes, there are many breaking API changes that version 1 users should be aware of. This document outlines your options for upgrading.
The version 1 series was tightly coupled to Interactive Brokers (IBKR) for broker and data functions, and IBKR conids were the security IDs used throughout QuantRocket. In version 2, IBKR is one broker and one data provider among several. This has necessitated two major categories of changes:
Security IDs: IBKR conids are no longer used as the security IDs, except internally to communicate with the IBKR API. In version 2, security IDs are called sids (short for Security ID) and are based on FIGI identifiers. This change allows important benefits including the ability to mix and match data from different providers, improved continuity of data across ticker changes and other corporate actions, and support for survivorship-bias free data. However, changing security IDs is a major change that touches nearly all parts of the software, including database structures.
Numerous commands and functions for working with Interactive Brokers that were generically named in version 1 are renamed in version 2 to reflect their association to IBKR. For example, the function create_db
is now create_ibkr_db
to distinguish it from other, similar functions for other data providers. There is no longer a function simply called create_db
. A full list of API changes is provided below.
In addition, underlying libraries in the Anaconda distribution have been updated, including Pandas. Library updates always create a risk of breakages in user code, especially in the case of Pandas.
Version 1 subscriptions are not valid for version 2. To use version 2 beyond the evaluation features, a version 2 subscription is required.
To view the version 2 pricing, please log in. When you are ready to purchase, please contact us first so we can apply a pro-rated credit for your version 1 subscription which will partially offset your purchase price. (This pro-ration step is not handled automatically by the website for v1 to v2 upgrades.)
You can try version 2 using the free evaluation license before deciding whether to upgrade. We recommend doing a fresh installation of version 2 onto a different computer (or cloud server) from the one running your version 1 deployment. Simply follow the standard installation instructions.
(While it is possible to run version 1 and 2 on the same local computer by specifying a different --project-name
in the docker-compose
command and by changing the houston port, this is more advanced and can be confusing and lead to problems if you're not careful. Therefore we don't recommend it for most users.)
If you decide to upgrade to version 2, there are several options for deploying version 2. You can start over with version 2, migrate version 1 to version 2, or run version 1 and version 2 as two separate deployments.
The easiest approach, which may be suitable for users who have not invested a substantial amount of time in version 1, is simply to start over with version 2.
For Mac and Windows users, the easiest way to completely start over is to uninstall Docker Desktop, which will delete all QuantRocket images and containers as well as any data you've collected or code you've created inside JupyterLab. (Back up anything you want to keep before doing this.) Then use the installation guide to install version 2.
The second option is to migrate your version 1 deployment to version 2. With this approach, you run a single deployment, replacing version 1 with version 2. There is a migration kit on GitHub to migrate your databases and highlight API changes that should be made in your code. The kit shows you the steps to follow to make sure you can revert back to version 1 if anything goes wrong.
To undertake this approach:
$ quantrocket codeload clone 'migrate-v1-to-v2'
The third option is to continue running your legacy code unchanged on version 1 and run version 2 as a new, completely separate deployment.
This option may be appealing if you are running trading strategies under version 1 and are risk averse to making changes to the environment they run under. You can use version 2 for new research and strategies while leaving your old strategies unchanged.
If you are interested in this option, you can receive complimentary continued access to version 1 with your version 2 upgrade. We will keep your version 1 subscription active but disable future charges. Only your version 2 subscription will be billed. Just reach out and tell us this is what you want to do.
Note the following downsides of running two separate deployments:
We hope you will want to take advantage of the many new features and benefits of version 2. However, if you choose not to upgrade to version 2, you can continue using version 1 with your existing subscription.
Below are the version 1 APIs that have changed in version 2. (New version 2 functionality is not documented here.)
The migration kit will help you find any places in your code where you are using the old version 1 APIs.
With the addition of new data and brokers, the following commands and functions have been renamed to be more specific:
Version 1 | Version 2 |
---|---|
quantrocket.fundamental.collect_shortable_shares | quantrocket.fundamental.collect_ibkr_shortable_shares |
quantrocket.fundamental.download_shortable_shares | quantrocket.fundamental.download_ibkr_shortable_shares |
quantrocket.fundamental.get_shortable_shares_reindexed_like | quantrocket.fundamental.get_ibkr_shortable_shares_reindexed_like |
quantrocket.fundamental.collect_borrow_fees | quantrocket.fundamental.collect_ibkr_borrow_fees |
quantrocket.fundamental.download_borrow_fees | quantrocket.fundamental.download_ibkr_borrow_fees |
quantrocket.fundamental.get_borrow_fees_reindexed_like | quantrocket.fundamental.get_ibkr_borrow_fees_reindexed_like |
quantrocket.history.create_db | quantrocket.history.create_ibkr_db |
quantrocket.launchpad.get_credentials | quantrocket.ibg.get_credentials |
quantrocket.launchpad.set_credentials | quantrocket.ibg.set_credentials |
quantrocket.launchpad.list_gateway_statuses | quantrocket.ibg.list_gateway_statuses |
quantrocket.launchpad.start_gateways | quantrocket.ibg.start_gateways |
quantrocket.launchpad.stop_gateways | quantrocket.ibg.stop_gateways |
quantrocket.launchpad.load_launchpad_config | quantrocket.ibg.load_ibg_config |
quantrocket.launchpad.get_launchpad_config | quantrocket.ibg.get_ibg_config |
quantrocket.master.collect_listings | quantrocket.master.collect_ibkr_listings |
quantrocket.master.collect_option_chains | quantrocket.master.collect_ibkr_option_chains |
quantrocket.master.diff_securities | quantrocket.master.diff_ibkr_securities |
quantrocket.master.delist_security | quantrocket.master.delist_ibkr_security |
quantrocket.master.create_combo | quantrocket.master.create_ibkr_combo |
quantrocket.master.collect_calendar | quantrocket.master.collect_ibkr_calendar |
moonshot.commission.PercentageCommission.IB_COMMISSION_RATE | moonshot.commission.PercentageCommission.BROKER_COMMISSION_RATE |
moonshot.commission.PercentageCommission.IB_COMMISSION_RATE_TIER_2 | moonshot.commission.PercentageCommission.BROKER_COMMISSION_RATE_TIER_2 |
moonshot.commission.FuturesCommission.IB_COMMISSION_PER_CONTRACT | moonshot.commission.FuturesCommission.BROKER_COMMISSION_PER_CONTRACT |
moonshot.commission.PerShareCommission.IB_COMMISSION_PER_SHARE | moonshot.commission.PerShareCommission.BROKER_COMMISSION_PER_SHARE |
moonshot.commission.PerShareCommission.IB_COMMISSION_PER_SHARE_TIER_2 | moonshot.commission.PerShareCommission.BROKER_COMMISSION_PER_SHARE_TIER_2 |
moonshot.slippage.BorrowFees | moonshot.slippage.IBKRBorrowFees |
quantrocket.realtime.create_tick_db | quantrocket.realtime.create_ibkr_tick_db |
quantrocket.zipline.run_algorithm | quantrocket.zipline.backtest |
quantrocket.zipline.ingest_bundle | quantrocket.zipline.create_db_bundle and quantrocket.zipline.ingest_bundle (see Zipline usage guide) |
quantrocket.zipline.clean_bundles | quantrocket.zipline.drop_bundle |
ib_trading_calendars | quantrocket_trading_calendars |
Version 1 | Version 2 |
---|---|
quantrocket fundamental collect-financials | quantrocket fundamental collect-reuters-financials |
quantrocket fundamental collect-estimates | quantrocket fundamental collect-reuters-estimates |
quantrocket fundamental collect-shortshares | quantrocket fundamental collect-ibkr-shortshares |
quantrocket fundamental collect-shortfees | quantrocket fundamental collect-ibkr-borrowfees |
quantrocket fundamental collect-sharadar | quantrocket fundamental collect-sharadar-fundamentals |
quantrocket fundamental financials | quantrocket fundamental reuters-financials |
quantrocket fundamental codes | quantrocket fundamental reuters-codes |
quantrocket fundamental estimates | quantrocket fundamental reuters-estimates |
quantrocket fundamental shortshares | quantrocket fundamental ibkr-shortshares |
quantrocket fundamental shortfees | quantrocket fundamental ibkr-borrowfees |
quantrocket fundamental sharadar | quantrocket fundamental sharadar-fundamentals |
quantrocket history create-db | quantrocket history create-ibkr-db |
quantrocket launchpad credentials | quantrocket ibg credentials |
quantrocket launchpad status | quantrocket ibg status |
quantrocket launchpad start | quantrocket ibg start |
quantrocket launchpad stop | quantrocket ibg stop |
quantrocket launchpad config | quantrocket ibg config |
quantrocket master exchanges | quantrocket master list-ibkr-exchanges |
quantrocket master collect | quantrocket master collect-ibkr |
quantrocket master options | quantrocket master collect-ibkr-options |
quantrocket master diff | quantrocket master diff-ibkr |
quantrocket master delist | quantrocket master delist-ibkr |
quantrocket master create-combo | quantrocket master create-ibkr-combo |
quantrocket master collect-calendar | quantrocket master collect-ibkr-calendar |
quantrocket realtime create-tick-db | quantrocket realtime create-ibkr-tick-db |
quantrocket zipline run | quantrocket zipline backtest |
quantrocket zipline ingest | quantrocket zipline create-db-bundle and quantrocket zipline ingest (see Zipline usage guide) |
quantrocket zipline bundles | quantrocket zipline list-bundles |
quantrocket zipline clean | quantrocket zipline drop-bundle |
The IB Gateway permission configuration file quantrocket.launchpad.permissions.yml
, if used, should be renamed quantrocket.ibg.permissions.yml
.
The following functions and commands which previously accepted conids (conids
/--conids
) now accept sids instead (sids
/--sids
):
quantrocket.account.download_account_portfolio
/ quantrocket account portfolio
quantrocket.blotter.cancel_orders
/ quantrocket blotter cancel
quantrocket.blotter.download_order_statuses
/ quantrocket blotter status
quantrocket.blotter.download_positions
/ quantrocket blotter positions
quantrocket.blotter.list_positions
quantrocket.blotter.close_positions
/ quantrocket blotter close
quantrocket.blotter.download_executions
/ quantrocket blotter executions
quantrocket.blotter.download_pnl
/ quantrocket blotter pnl
quantrocket.fundamental.collect_reuters_financials
/ quantrocket fundamental collect-reuters-financials
quantrocket.fundamental.collect_reuters_estimates
/ quantrocket fundamental collect-reuters-estimates
quantrocket.fundamental.collect_wsh_earnings_dates
/ quantrocket fundamental collect-wsh
quantrocket.fundamental.download_reuters_financials
/ quantrocket fundamental reuters-financials
quantrocket.fundamental.download_reuters_estimates
/ quantrocket fundamental reuters-estimates
quantrocket.fundamental.download_wsh_earnings_dates
/ quantrocket fundamental wsh
quantrocket.fundamental.download_sharadar_fundamentals
/ quantrocket fundamental sharadar-fundamentals
quantrocket.fundamental.download_ibkr_shortable_shares
/ quantrocket fundamental ibkr-shortshares
quantrocket.fundamental.download_ibkr_borrow_fees
/ quantrocket fundamental ibkr-borrowfees
quantrocket.history.create_ibkr_db
/ quantrocket history create-ibkr-db
quantrocket.history.collect_history
/ quantrocket history collect
quantrocket.history.download_history_file
/ quantrocket history get
quantrocket.master.collect_ibkr_listings
/ quantrocket master collect-ibkr
quantrocket.master.collect_ibkr_option_chains
/ quantrocket master collect-ibkr-options
quantrocket.master.diff_ibkr_securities
/ quantrocket master diff-ibkr
quantrocket.master.download_master_file
/ quantrocket master get
quantrocket.master.delist_ibkr_security
/ quantrocket master delist-ibkr
quantrocket.get_prices
quantrocket.realtime.create_ibkr_tick_db
/ quantrocket realtime create-ibkr-tick-db
quantrocket.realtime.collect_market_data
/ quantrocket realtime collect
quantrocket.realtime.cancel_market_data
/ quantrocket realtime cancel
quantrocket.realtime.download_market_data_file
/ quantrocket realtime get
quantrocket realtime stream
Similarly, functions and commands which accepted --exclude-conids
/exclude_conids
now accept --exclude-sids
/exclude_sids
:
quantrocket.fundamental.download_reuters_financials
/ quantrocket fundamental reuters-financials
quantrocket.fundamental.download_reuters_estimates
/ quantrocket fundamental reuters-estimates
quantrocket.fundamental.download_wsh_earnings_dates
/ quantrocket fundamental wsh
quantrocket.fundamental.download_sharadar_fundamentals
/ quantrocket fundamental sharadar-fundamentals
quantrocket.fundamental.download_ibkr_shortable_shares
/ quantrocket fundamental ibkr-shortshares
quantrocket.fundamental.download_ibkr_borrow_fees
/ quantrocket fundamental ibkr-borrowfees
quantrocket.history.download_history_file
/ quantrocket history get
quantrocket.master.download_master_file
/ quantrocket master get
quantrocket.get_prices
quantrocket.realtime.download_market_data_file
/ quantrocket realtime get
quantrocket realtime stream
The following Moonshot class attributes have changed:
CONIDS
is now SIDS
EXCLUDE_CONIDS
is now EXCLUDE_SIDS
BENCHMARK
, if used, should reference a sid, not a conidIn version 1, there were separate securities master "domains" for IBKR and Sharadar records. In version 2, all vendors are consolidated in a single securities master database allowing data to be seamlessly mixed and matched. Therefore, the "domain" concept is no longer applicable, and accordingly the domain
parameter has been removed from the following functions and commands:
quantrocket.master.download_master_file
/ quantrocket master get
quantrocket.master.get_securities_reindexed_like
quantrocket.master.list_universes
/ quantrocket master list-universes
quantrocket.master.create_universe
/ quantrocket master universe
quantrocket.master.delete_universe
/ quantrocket master delete-universe
quantrocket.fundamental.download_sharadar_fundamentals
/ quantrocket fundamental sharadar-fundamentals
quantrocket.fundamental.get_sharadar_fundamentals_reindexed_like
With the advent of multiple data vendors, many IBKR-specific fields in the securities master file are now prefixed with ibkr_
:
Version 1 | Version 2 |
---|---|
ConId | ibkr_ConId |
PrimaryExchange | ibkr_PrimaryExchange |
TradingClass | ibkr_TradingClass |
MarketName | ibkr_MarketName |
LongName | ibkr_LongName |
ValidExchanges | ibkr_ValidExchanges |
AggGroup | ibkr_AggGroup |
Sector | ibkr_Sector |
Industry | ibkr_Industry |
Category | ibkr_Category |
MinTick | ibkr_MinTick |
MdSizeMultiplier | ibkr_MdSizeMultiplier |
ContractMonth | ibkr_ContractMonth |
RealExpirationDate | ibkr_RealExpirationDate |
UnderConId | ibkr_UnderConId |
UnderSymbol | ibkr_UnderSymbol |
UnderSecType | ibkr_UnderSecType |
MarketRuleIds | ibkr_MarketRuleIds |
Strike | ibkr_Strike |
Right | ibkr_Right |
ComboLegs | ibkr_ComboLegs |
EvRule | ibkr_EvRule |
EvMultiplier | ibkr_EvMultiplier |
In version 2, the Symbol
field in the securities master file for IBKR securities returns the version 1 LocalSymbol
field if available, otherwise the version 1 Symbol
field. The version 1 Symbol
and LocalSymbol
fields were usually identical for stocks but for futures LocalSymbol
is more specific. To preserve version 1 functionality, perform the following replacements:
Version 1 | Version 2 |
---|---|
Symbol | ibkr_Symbol |
LocalSymbol | ibkr_LocalSymbol |
In version1, ISINs were stored in the Cusip
field with a prefix of "ISIN:". Now they are stored in the ibkr_Isin
field, without any prefix.
In version 2, the Anaconda version has been updated to Anaconda 2020.02. Version 1 was based on Anaconda 5.2.0. Major updates include:
In addition to the API changes above, all API parameters and function names which were deprecated in previous releases have been fully removed in version 2. Please refer to the 1.x release notes for a list of these deprecations.