Brokerages
Trading Technologies
Introduction
QuantConnect enables you to run your algorithms in live mode with real-time market data. We have successfully hosted more than 200,000 live algorithms and have had more than $22B in volume traded on our servers since 2015.
Trading Technologies (TT) was founded by Gary Kemp in 1994 with the goal to create professional trading software, infrastructure, and data solutions for a wide variety of users. TT provides access to trading Futures, Options, and Crypto. TT also provides a charting platform, infrastructure services, and risk management tools. TT is not actually a brokerage. The firm is a brokerage router with access to more than 30 execution destinations.
To view the implementation of the TT integration, see the Lean.Brokerages.TradingTechnologies repository.
Account Types
The TradingTechnologiesBrokerageModel
does not have specific modeling for fees and slippage because TT is an order router and can execute on many exchanges and brokerages. To set the brokerage model and account type in an algorithm, see the TT brokerage model documentation. In live trading, TT reports the total fees of your orders after each order fill. Pass a different BrokerageName
to SetBrokerageModel
set_brokerage_model
to backtest your algorithm with fee and slippage modeling. The brokerage model you set should support the asset classes and orders in your algorithm.
Create an Account
Follow the account creation wizard on the TT website to create a TT account.
Paper Trading
Trading Technologies provides a separate User Acceptance Testing (UAT) Certification environment at uat.trade.tt. The TT UAT environment connects to actual exchange certification environments for both market data and order routing.
To create a UAT account, follow the UAT account creation wizard on the TT website.
Create Deployment Credentials
After you create your TT account, see Create TT Users to create your live deployment credentials.
Asset Classes
Our TT integration supports trading Futures.
Data Providers
The QuantConnect data provider provides Futures data during live trading.
Orders
We model the TT API by supporting several order types, the TimeInForce
order property, and order updates. When you deploy live algorithms, you can place manual orders through the IDE.
Order Types
The following table describes the available order types for each asset class that our TT integration supports:
Order Type | Futures |
---|---|
Market | |
Limit | |
Stop market | |
Stop limit |
TT enforces the following order rules:
- If you are buying (selling) with a
StopMarketOrder
stop_market_order
or aStopLimitOrder
stop_limit_order
, the stop price of the order must be greater (less) than the current security price. - If you are buying (selling) with a
StopLimitOrder
stop_limit_order
, the limit price of the order must be greater (less) than the stop price.
Time In Force
We model the TT API by supporting the Day
DAY
and GoodTilCanceled
GOOD_TIL_CANCELED
TimeInForce order properties.
Updates
We model the TT API by supporting order updates.
Margin
We model buying power and margin calls to ensure your algorithm stays within the margin requirements.
Slippage
Orders through TT do not experience slippage in backtests. In live trading, your orders may experience slippage.
To view how we model TT slippage, see Slippage.
Fills
We fill market orders immediately and completely in backtests. In live trading, if the quantity of your market orders exceeds the quantity available at the top of the order book, your orders are filled according to what is available in the order book.
To view how we model TT order fills, see Fills.
Security and Stability
Note the following security and stability aspects of our TT integration.
Account Credentials
When you deploy live algorithms with TT, we don't save your brokerage account credentials.
API Outages
We call the TT API to place live trades. Sometimes the API may be down. Check the TT status page to see if the API is currently working.
Create TT Users
Follow these steps to create your TT user name, account name, remote comp id, session password, app key, and app secret:
Part 1: Sign in
On the TT website, sign in to your TT account or your TT UAT account. If you don't have an account, see Account Types to create one.
Part 2: Add a New User
- In the top navigation bar, click .
- On the Setup page, click .
- In the New User window, click the radio button that corresponds to user's employment status in your company and then click .
- On the New User page, fill in the form with information about the new user.
- Click .
- On the Setup page, click the new user in the table and then click .
The name that you put in the Username field is the username you will need when deploying live algorithms with LEAN.
In the Status section, click the Trade Mode field and then click from the drop-down menu.
In the Advanced Settings section, select the Can create TT Rest API Key and Can create TT.NET SDK Client Side key check boxes.
Part 3: Create an App Key for the New User
- On the Setup page, click the new user in the table and then click the App Keys tab.
- In the App Keys section, click .
- In the Create New Application Key window, enter an application key name (for example, qb_alex_app_key), select for application key type and then click .
- Click and save it somewhere safe, like a text editor.
- Click .
The text you copy contains the App Key and App Secret separated by a colon. For example, a79b17df-b249-45a1-9d12-d5bbd2964626:424cc666-42aa-4125-a48e-13f630afd5a1.
Part 4: Create an Account for the New User
- On the Setup page, in the left navigation bar, click .
- On the Accounts page, click .
- On the New User page, fill in the form with the following information:
- Set the account name to something representative (for example, QC).
- If there is a parent account, select it in the Parent field.
- In the Parent field, select .
- Click .
- On the Account page, click the new account in the table and then click the Users tab.
- In the Users section, click .
- In the Select Users window, click the new user and then click .
- Click .
Part 5: Create a FIX Session for the New User
- On the Setup page, in the left navigation bar, click .
- On the FIX Sessions page, click .
- On the New FIX Sessions page, fill in the form with the following information:
- Set the FIX Session Name to something representative (for example, QC).
- In the FIX Type field, select .
- Set the Remote Comp ID to something representative (for example, qc_alex_id).
- Select the Send unsolicited order and fill message check box.
- In the Status section, deselect the Inactive check box.
- Click .
- On the FIX Sessions page, click the new FIX session in the table and then click the Users tab.
- In the Users section, click .
- In the Select Users window, click the new user and then click .
- Click .
This Id is the remote comp id you will use when deploying live algorithms with LEAN.
The session password you set in this form is the password you will use when deploying live algorithms with LEAN.
Part 6: Verify the User Credentials
- On the Setup page, in the left navigation bar, click .
- On the Users page, click the new user in the table and then review the information under the FIX Sessions and App Keys tabs.
Deploy Live Algorithms
You must have an available live trading node for each live trading algorithm you deploy.
Follow these steps to deploy a live algorithm:
- Open the project you want to deploy.
- Click the Deploy Live icon.
- On the Deploy Live page, click the Brokerage field and then click from the drop-down menu.
- Enter your TT user name, account name, remote comp id, session password, app key, and app secret.
- Click the Environment field and then click one of the environments from the drop-down menu.
- Click the Node field and then click the live trading node that you want to use from the drop-down menu.
- (Optional) In the Data Provider section, click and change the data provider or add additional providers.
- If your brokerage account has existing cash holdings, follow these steps (see video):
- In the Algorithm Cash State section, click .
- Click .
- Enter the currency ticker (for example, USD or CAD) and a quantity.
- (Optional) Set up notifications.
- Configure the Automatically restart algorithm setting.
- Click .
To get your credentials, see Create TT Users.
Our TT integration routes orders via the TT FIX 4.4 Connection. Contact your TT representative to set the exchange where you would like your orders sent. Your account details are not saved on QuantConnect.
Our integration fetches your positions using the REST endpoint, so the app key and app secret are your REST App credentials.
The following table shows the supported environments:
Environment | Description |
---|---|
Live | Trade in the production environment |
UAT | Trade in the User Acceptance Testing environment |
By enabling automatic restarts, the algorithm will use best efforts to restart the algorithm if it fails due to a runtime error. This can help improve the algorithm's resilience to temporary outages such as a brokerage API disconnection.
The deployment process can take up to 5 minutes. When the algorithm deploys, the live results page displays. If you know your brokerage positions before you deployed, you can verify they have been loaded properly by checking your equity value in the runtime statistics, your cashbook holdings, and your position holdings.