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

# TradeStation

[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) > TradeStation

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

## Introduction

This page explains the `TradeStationBrokerageModel`, 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.TRADE_STATION, AccountType.CASH)
self.set_brokerage_model(BrokerageName.TRADE_STATION, 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/TradeStationBrokerageModel/) and [implementation](https://github.com/QuantConnect/Lean/blob/master/Common/Brokerages/TradeStationBrokerageModel.cs).

## Asset Classes

The `TradeStationBrokerageModel` supports trading the following asset classes:

- [US Equities](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/us-equity.md)
- [Equity Options](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/equity-options.md)
- [Futures](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/futures.md)
- [Index](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/index.md)
- [Index Options](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/index-options.md)

## Orders

The `TradeStationBrokerageModel` supports several order types, order properties, and order updates.

### Order Types

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

| Order Type | Equity | Equity Options | Index Options | Futures |
| --- | --- | --- | --- | --- |
| [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) | ![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) | ![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) | ![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) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Trailing stop](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/trailing-stop-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Market on Open](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/market-on-open-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |  |  |  |
| [Market on Close](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/market-on-close-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |  |  |  |
| [Combo market](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/combo-market-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Combo limit](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/combo-limit-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [Bracket](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/contingent-orders/bracket-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [One cancels other](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/contingent-orders/one-cancels-other-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [One triggers other](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/contingent-orders/one-triggers-other-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |
| [One updates other](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/contingent-orders/one-updates-other-orders.md) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) |

### Order Properties

The `TradeStationBrokerageModel` supports custom order properties. The following table describes the members of the `TradeStationOrderProperties` 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` |
| `post_only` | `bool` | This flag will ensure the limit order executes only as a maker (no fee) order. If part of the order results in taking liquidity rather than providing, it will be rejected and no part of the order will execute. Equities only. | `False` |

```python
def initialize(self) -> None:
    # Set the default order properties
    self.default_order_properties = TradeStationOrderProperties()
    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 = TradeStationOrderProperties()
    order_properties.post_only = True
    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)
```

### Contingent Orders

TradeStation accepts sets of [contingent orders](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-types/contingent-orders.md) with the following rules:

- Every order in the set is a single-leg order. TradeStation doesn't accept combo orders in a set.
- An order that another order triggers can't trigger other orders in turn.
- The orders in a one updates other set are for the same security, and at least one of them is a stop market, stop limit, or trailing stop order.
- When an order in a one cancels other or one updates other set fills, TradeStation cancels or resizes the rest of the set. If you cancel an order in the set, the other orders keep working.

### Updates

The `TradeStationBrokerageModel` supports [order updates](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/order-tickets.md#04-Update-Orders).

### Handling Splits

If you're using raw [data normalization](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/us-equity/requesting-data.md#11-Data-Normalization) and you have active orders with a limit, stop, or trigger price in the market for a US Equity when a [stock split](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/us-equity/corporate-actions.md#02-Splits) occurs, the following properties of your orders automatically adjust to reflect the stock split:

- Quantity
- Limit price
- Stop price
- Trigger price

## Fills

The following table shows the [fill model](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/key-concepts.md) that the `TradeStationBrokerageModel` uses for each `SecurityType`:

| `SecurityType` | Fill Model |
| --- | --- |
| `Equity` | [EquityFillModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/supported-models/equity-model.md) |
| `Option` | [ImmediateFillModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/supported-models/immediate-model.md) |
| `Future` | [FutureFillModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/supported-models/future-model.md) |

## Slippage

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

## Fees

The `TradeStationBrokersBrokerageModel` uses the [TradeStationFeeModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/transaction-fees/supported-models.md#18-TradeStation-Model) with the default argument values. We model current [TradeStation](https://qnt.co/tradestation-signup) fees on all assets.

## Buying Power

The `TradeStationBrokerageModel` sets the buying power model based on the asset class of the security. The following table shows the default buying power model of each asset class:

| Asset Class | Model |
| --- | --- |
| Equities | `SecurityMarginModel` |
| Equity Options | `OptionMarginModel` |
| Futures | `FutureMarginModel` |

If you have a margin account, the `TradeStationBrokerageModel` allows 2x leverage for Equities and and 1x leverage for Equity Options and Futures.

## Settlement

The following table shows which [settlement model](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/key-concepts.md) the `TradeStationBrokerageModel` uses based on the security type and your account type:

| Security Type | Account Type | Settlement Model |
| --- | --- | --- |
| Equity | Cash | [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) |
| Option | Cash | [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) |
| Future | Any | [FutureSettlementModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/supported-models.md#05-Future-Model) |

For all other cases, the `TradeStationBrokerageModel` uses the [ImmediateSettlementModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/supported-models.md#02-Immediate-Model).

```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 Futures
security.set_settlement_model(FutureSettlementModel())

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

## Margin Interest Rate

The `TradeStationBrokerageModel` 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 following table describes the default markets of each `SecurityType` for the `TradeStationBrokerageModel`:

| `SecurityType` | `Market` |
| --- | --- |
| `Equity` | `USA` |
| `Option` | `USA` |
| `Future` | `CME` |

## Account Currency

The `TradeStationBrokerageModel` 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).
