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

# Public

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

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

## Introduction

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

## Asset Classes

The `PublicBrokerageModel` supports 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)
- [Index Options](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/index-options.md)
- [Crypto](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/crypto.md)

## Orders

The `PublicBrokerageModel` 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 `PublicBrokerageModel` supports:

| Order Type | Equity | Equity Options | Index Options | Crypto |
| --- | --- | --- | --- | --- |
| [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) |
| [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) |  |

### Order Properties

The `PublicBrokerageModel` supports custom order properties. The following table describes the members of the `PublicOrderProperties` 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` Public natively supports only day and good-til-date orders, so LEAN sends good-til-canceled orders as good-til-date orders that expire 90 days out. | `TimeInForce.GOOD_TIL_CANCELED` |
| `outside_regular_trading_hours` | `bool` | If set to true, allows the order to trigger or fill outside of regular trading hours. This property applies to Equity limit orders with a day time-in-force only, since Public only accepts limit orders in the extended session. | `False` |
| `use_margin` | `bool?` | Controls the buying power the order uses. If set to true, the order uses margin buying power when the account allows it. If set to false, the order uses cash-only (settled cash) buying power. If you don't set it, orders on margin accounts use margin buying power and orders on cash accounts always use cash-only buying power. | `None` |

```python
def initialize(self) -> None:
    # Set the default order properties
    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 = PublicOrderProperties()
    order_properties.time_in_force = TimeInForce.DAY
    order_properties.outside_regular_trading_hours = True
    order_properties.use_margin = False
    self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)
```

### Updates

The `PublicBrokerageModel` supports [order updates](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/order-tickets.md#04-Update-Orders) for single-leg orders. Public doesn't support updating combo (multi-leg) 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 `PublicBrokerageModel` 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 Equity Options, Index Options, and Crypto trades.

## Slippage

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

## Fees

The `PublicBrokerageModel` uses the [PublicFeeModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/transaction-fees/supported-models.md#15-Public-Model).

## Buying Power

The `PublicBrokerageModel` uses the `SecurityMarginModel` for Equity trades and the `OptionMarginModel` for Equity Option and Index Option trades. For Crypto trades, it uses the `CashBuyingPowerModel` for cash accounts and the `SecurityMarginModel` for margin accounts.

If you have a margin account, the `PublicBrokerageModel` allows up to 2x leverage for Equity trades. The `use_margin` [order property](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/public.md#03-Orders) selects the buying power each order uses at the brokerage.

## Settlement

The `PublicBrokerageModel` 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 with Equity and Equity Options.

```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 `PublicBrokerageModel` 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 `PublicBrokerageModel` is `Market.USA` for Equity, Equity Options, and Index Options. It's `Market.COINBASE` for Crypto.

## Account Currency

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