Brokerages

Tradier

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.

Tradier was founded by Dan Raju, Peter Laptewicz, Jason Barry, Jeyashree Chidambaram, and Steve Agalloco in 2012 with the goal to "deliver a choice of low-cost, high-value brokerage services to traders". Tradier provides access to trading Equities and Options for clients in over 250 countries and territories with no minimum deposit for cash accounts. Tradier also delivers custody, clearing, execution, and billing on behalf of registered advisors.

To view the implementation of the Tradier brokerage integration, see the Lean.Brokerages.Tradier repository.

Account Types

Tradier supports cash and margin accounts. To set the account type in an algorithm, see the Tradier brokerage model documentation.

Create an Account

Follow the account creation wizard on the Tradier website to create a Tradier account.

You will need your account ID and access token to deploy live algorithms. After you have an account, get your account ID and token from the Settings > API Access page on the Tradier website. Your account ID is the alpha-numeric code in a drop-down field on the page.

Paper Trading

Tradier supports paper trading, but with the following caveats:

  • Account activity is unavailable since this information is populated from Tradier's clearing firm.
  • Streaming Tradier market data is unavailable due to exchange restrictions related to delayed data.

To get your paper trading account number and access token, open the API Access page on the Tradier website and then scroll down to the Sandbox Account Access (Paper Trading) section.

If you trade Equities, you can use the QuantConnect data provider to get real-time data. If you trade Options, you must use delayed data from the Tradier data provider. If you trade Equities and Options, use both data providers. However, if you trade with the demo environment, Tradier doesn't offer streaming market data due to exchange restrictions related to delayed data, so you must use our data provider.

Asset Classes

Our Tradier integration supports trading US Equities and Equity Options.

You may not be able to trade all assets with Tradier. For example, if you live in the EU, you can't trade US ETFs. Check with your local regulators to know which assets you are allowed to trade. You may need to adjust settings in your brokerage account to live trade some assets.

Data Providers

You might need to purchase a Tradier market data subscription for your trading. For more information about live data providers, see Datasets.

Orders

We model the Tradier API by supporting several order types and the TimeInForce order property. Tradier partially supports order updates, but does not support trading during extended market hours. 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 Tradier integration supports:

Order TypeEquityEquity Options
Marketgreen checkgreen check
Limitgreen checkgreen check
Stop marketgreen checkgreen check
Stop limitgreen checkgreen check

Time In Force

We model the Tradier API by supporting the following TimeInForce instructions:

  • DayDAY
  • GoodTilCanceledGOOD_TIL_CANCELED (not available for short selling)

Updates

We model the Tradier API by supporting most order updates. To update the quantity of an order, cancel the order and then submit a new order with the desired quantity. For more information about this workaround, see the Workaround for Brokerages That Don’t Support Updates.

Extended Market Hours

Tradier doesn't support extended market hours trading. If you place an order outside of regular trading hours, the order will be processed at market open.

Automatic Cancellations

If you have open orders for a security when it performs a reverse split, Tradier automatically cancels your orders.

Errors

To view the order-related error codes from Tradier, see Error Responses in their documentation.

Fees

To view the Tradier trading fees, see the Pricing page on the Tradier 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. If you have more than $25,000 in your brokerage account, you can use the PatternDayTradingMarginModel to make use of the 4x intraday leverage and 2x overnight leverage available on most brokerages from the PDT rule.

Slippage

Orders through Tradier do not experience slippage in backtests. In live trading, your orders may experience slippage.

To view how we model Tradier 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 Tradier order fills, see Fills.

Settlements

If you trade with a margin account, trades settle immediately

To view how we model settlement for Tradier trades, see Settlement.

Security and Stability

Note the following security and stability aspects of our Tradier integration.

Account Credentials

When you deploy live algorithms with Tradier, we don't save your brokerage account credentials.

API Outages

We call the Tradier API to place live trades. Sometimes the API may be down. Check the Tradier 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 Tradier brokerage:

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 Tradier from the drop-down menu.
  4. Enter your Tradier account Id and token.
  5. To get your account ID and token, see the Create an Account section in the Account Types documentation. Your account details are not saved on QuantConnect.

  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
    RealTrade with real money
    DemoTrade with paper money
  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. In most cases, we suggest using the QuantConnect data provider, the Tradier data provider, or both. The order you set them in the deployment wizard defines their order of precedence in Lean.

  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: