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 SetBrokerageModelset_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 TypeFutures
Marketgreen check
Limitgreen check
Stop marketgreen check
Stop limitgreen check

TT enforces the following order rules:

  • If you are buying (selling) with a StopMarketOrderstop_market_order or a StopLimitOrderstop_limit_order, the stop price of the order must be greater (less) than the current security price.
  • If you are buying (selling) with a StopLimitOrderstop_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 DayDAY and GoodTilCanceledGOOD_TIL_CANCELED TimeInForce order properties.

Updates

We model the TT API by supporting order updates.

Fees

To view the TT trading fees, see the Pricing page on the TT website. To view how we model their fees, see Fees.

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.

Deposits and Withdrawals

You can deposit and withdraw cash from your brokerage account while you run an algorithm that's connected to the account. We sync the algorithm's cash holdings with the cash holdings in your brokerage account every day at 7:45 AM Eastern Time (ET).

Demo Algorithm

The following algorithm demonstrates the functionality of the TT brokerage:

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

  1. In the top navigation bar, click Setup.
  2. On the Setup page, click +New User.
  3. In the New User window, click the radio button that corresponds to user's employment status in your company and then click Continue.
  4. On the New User page, fill in the form with information about the new user.
  5. 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 TT Pro 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.

  6. Click Create.
  7. On the Setup page, click the new user in the table and then click Send Invitation.

Part 3: Create an App Key for the New User

  1. On the Setup page, click the new user in the table and then click the App Keys tab.
  2. In the App Keys section, click New.
  3. In the Create New Application Key window, enter an application key name (for example, qb_alex_app_key), select TT REST API for application key type and then click Create.
  4. Click Copy Secret to Clipboard and save it somewhere safe, like a text editor.
  5. 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.

  6. Click OK.

Part 4: Create an Account for the New User

  1. On the Setup page, in the left navigation bar, click Accounts.
  2. On the Accounts page, click +New Account.
  3. 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 Routing (internal sub-account).
  4. Click Create.
  5. On the Account page, click the new account in the table and then click the Users tab.
  6. In the Users section, click +Add.
  7. In the Select Users window, click the new user and then click Select.
  8. Click Save Changes.

Part 5: Create a FIX Session for the New User

  1. On the Setup page, in the left navigation bar, click FIX Sessions.
  2. On the FIX Sessions page, click +New FIX Session.
  3. 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 FIX Order Routing.
    • Set the Remote Comp ID to something representative (for example, qc_alex_id).
    • 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.

    • Select the Send unsolicited order and fill message check box.
    • In the Status section, deselect the Inactive check box.
  4. Click Create.
  5. On the FIX Sessions page, click the new FIX session in the table and then click the Users tab.
  6. In the Users section, click +Add.
  7. In the Select Users window, click the new user and then click Select.
  8. Click Save Changes.

Part 6: Verify the User Credentials

  1. On the Setup page, in the left navigation bar, click Users.
  2. 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:

  1. Open the project you want to deploy.
  2. Click the Lightning icon Deploy Live icon.
  3. On the Deploy Live page, click the Brokerage field and then click Trading Technologies from the drop-down menu.
  4. Enter your TT user name, account name, remote comp id, session password, app key, and app secret.
  5. 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.

  6. Click the Environment field and then click one of the environments from the drop-down menu.
  7. The following table shows the supported environments:

    EnvironmentDescription
    LiveTrade in the production environment
    UATTrade in the User Acceptance Testing environment
  8. Click the Node field and then click the live trading node that you want to use from the drop-down menu.
  9. (Optional) In the Data Provider section, click Show and change the data provider or add additional providers.
  10. If your brokerage account has existing cash holdings, follow these steps (see video):
    1. In the Algorithm Cash State section, click Show.
    2. Click Add Currency.
    3. Enter the currency ticker (for example, USD or CAD) and a quantity.
  11. (Optional) Set up notifications.
  12. Configure the Automatically restart algorithm setting.
  13. 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.

  14. Click Deploy.

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.

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: