---
title: "Tradier"
description: "This page explains the default security-level models and markets of the TradierBrokerageModel."
canonical: https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/tradier
markdown: https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/tradier.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/03%20Writing%20Algorithms/24%20Reality%20Modeling/05%20Brokerages/02%20Supported%20Models/12%20Tradier
modified: 2026-10-29
index: https://www.quantconnect.com/llms.txt
---

# Tradier

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Writing Algorithms](https://www.quantconnect.com/docs/v2/writing-algorithms.md) > Reality Modeling > Brokerages > [Supported Models](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models.md) > Tradier

> Code examples are shown in Python. Append `?lang=csharp` to this URL for the C# version of this page.

## Introduction

This page explains the `TradierBrokerageModel`, including the asset classes it supports, its default [security-level models](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/key-concepts.md#02-Security-Level-Models), and its default markets.

```python
self.set_brokerage_model(BrokerageName.TRADIER_BROKERAGE, AccountType.CASH)
self.set_brokerage_model(BrokerageName.TRADIER_BROKERAGE, AccountType.MARGIN)
```

For more information about this model, see the [class reference](https://www.lean.io/docs/v2/lean-engine/class-reference/py/QuantConnect/Brokerages/TradierBrokerageModel/) and [implementation](https://github.com/QuantConnect/Lean/blob/master/Common/Brokerages/TradierBrokerageModel.cs).

## Asset Classes

The `TradierBrokerageModel` supports trading [US Equities](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/us-equity.md) and [Equity Options](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/equity-options.md).

## Orders

The `TradierBrokerageModel` supports several order types, order properties, and most order updates.

### Order Types

The following table describes the available order types for each asset class that the `TradierBrokerageModel` supports:

| Order Type | Equity | Equity Options |
| --- | --- | --- |
| [Market](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/market-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Limit](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/limit-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Stop market](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/stop-market-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Stop limit](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/stop-limit-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |

### Order Properties

The `TradierBrokerageModel` supports custom order properties. The following table describes the members of the `TradierOrderProperties` object that you can set to customize order execution.

| Property | Data Type | Description | Default Value |
| --- | --- | --- | --- |
| `time_in_force` | `TimeInForce` | A [TimeInForce](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-properties.md#03-Time-In-Force) instruction to apply to the order. The following instructions are supported: `DAY` `GOOD_TIL_CANCELED` `good_til_date` | `TimeInForce.GOOD_TIL_CANCELED` |
| `outside_regular_trading_hours` | `bool` | A flag to signal that the order may be triggered and filled outside of regular trading hours. | `False` |

```python
def initialize(self) -> None:
    # Set the default order properties
    self.default_order_properties = TradierOrderProperties()
    self.default_order_properties.outside_regular_trading_hours = False
    self.default_order_properties.time_in_force = TimeInForce.GOOD_TIL_CANCELED

def on_data(self, slice: Slice) -> None:
    # Use default order order properties
    self.limit_order(self._symbol, quantity, limit_price)

    # Override the default order properties
    order_properties = TradierOrderProperties()
    order_properties.time_in_force = TimeInForce.DAY
    self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)

    order_properties.time_in_force = TimeInForce.good_til_date(datetime(year, month, day))
    order_properties.outside_regular_trading_hours = True
    self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)
```

### Updates

The `TradierBrokerageModel` supports most [order updates](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/order-tickets.md#04-Update-Orders). 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](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/order-tickets.md#workaround-for-brokerages-that-dont-support-updates).

### Extended Market Hours

The `TradierBrokerageModel` 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, the `TradierBrokerageModel` automatically cancels your orders.

### Errors

To view the order-related error codes from Tradier, see [Error Responses](https://documentation.tradier.com/brokerage-api/overview/errors) in their documentation.

The `TradierBrokerageModel` validates your orders for the following errors before sending them to Tradier:

| Error | Description |
| --- | --- |
| `ShortOrderIsGtc` | You can't short sell with the `GOOD_TIL_CANCELED` [time in force](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-properties.md#03-Time-In-Force) |
| `SellShortOrderLastPriceBelow5` | You can't short sell stocks below $5 |
| `IncorrectOrderQuantity` | The order quantity must be between 1 and 10,000,000 shares |

## Fills

The `TradierBrokerageModel` uses the [EquityFillModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/supported-models/equity-model.md) for Equity trades and the [ImmediateFillModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/supported-models/immediate-model.md) for Option trades.

## Slippage

The `TradierBrokerageModel` uses the [NullSlippageModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/slippage/supported-models.md#02-Null-Model).

## Fees

The `TradierBrokerageModel` uses the [ConstantFeeModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/transaction-fees/supported-models.md#02-Constant-Model) with zero fees.

```python
security.set_fee_model(ConstantFeeModel(0))
```

## Buying Power

The `TradierBrokerageModel` uses the `OptionMarginModel` for Option trades and the `SecurityMarginModel` for Equity trades.

If you have a margin account, the `TradierBrokerageModel` allows 2x leverage for Equities.

## Settlement

The `TradierBrokerageModel` uses the [ImmediateSettlementModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/supported-models.md#02-Immediate-Model) for margin accounts and the [DelayedSettlementModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/supported-models.md#03-Delayed-Model) with the [default settlement rules](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/key-concepts.md#03-Default-Behavior) for cash accounts.

```python
# For US Equities with a cash account:
security.set_settlement_model(DelayedSettlementModel(Equity.DEFAULT_SETTLEMENT_DAYS, Equity.DEFAULT_SETTLEMENT_TIME))

# For Equity Options with a cash account:
security.set_settlement_model(DelayedSettlementModel(Option.DEFAULT_SETTLEMENT_DAYS, Option.DEFAULT_SETTLEMENT_TIME))

# For remaining cases:
security.set_settlement_model(ImmediateSettlementModel())
```

## Margin Interest Rate

The `TradierBrokerageModel` uses the [NullMarginInterestRateModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/margin-interest-rate/supported-models.md#02-Null-Model).

## Default Markets

The default market of the `TradierBrokerageModel` is `Market.USA`.

## Account Currency

The `TradierBrokerageModel` doesn't set a default currency. To change the algorithm's currency from USD to a different currency, see [Set Account Currency](https://www.quantconnect.com/docs/v2/writing-algorithms/initialization.md#03-Set-Account-Currency).
