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. Brokerages supply a connection to the exchanges so that you can automate orders using LEAN. You can use multiple data feeds in live trading algorithms.
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 feed to get real-time data. If you trade Options, you must use delayed data from the Tradier data feed. If you trade Equities and Options, use the Tradier data feed. We don't currently have a hybrid QuantConnect-Tradier data feed. 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 feed.
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 Feeds
You might need to purchase a Tradier data feed subscription for your trading. For more information about live data feeds, see Data Feeds.
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 Type | Equity | Equity Options |
---|---|---|
MarketOrder | ![]() | ![]() |
LimitOrder | ![]() | ![]() |
StopMarketOrder | ![]() | ![]() |
StopLimitOrder | ![]() | ![]() |
Time In Force
We model the Tradier API by supporting the following TimeInForce instructions:
Day
GoodTilCanceled
(not available for short selling)GoodTilDate
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.
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
When you deploy live algorithms with Tradier, we don't save your brokerage account credentials.
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.
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 that 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 Tradier account Id and token.
- Click the Environment field and then click one of the environments from the drop-down menu.
- Click the Data Provider field and then click one of the data feeds 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) Set up notifications.
- Configure the Automatically restart algorithm setting.
- Click .
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.
The following table shows the supported environments:
Environment | Description |
---|---|
Real | Trade with real money |
Demo | Trade with paper money |
The following table describes the available data feeds:
Data Feed | Description |
---|---|
QuantConnect | Use data collected across all of the exchanges. For more details about this data feed, see Data Feeds. |
Tradier | Use data sourced directly from Tradier. This data feed isn't available for the demo environment. For more details about this data feed, see the Tradier data feed guide. |
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.