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

# Quant Bridge

[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) > Quant Bridge

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

## Introduction

This page explains the `QuantBridgeBrokerageModel`, 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.QUANT_BRIDGE, 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/QuantBridgeBrokerageModel/) and [implementation](https://github.com/QuantConnect/Lean/blob/master/Common/Brokerages/QuantBridgeBrokerageModel.cs).

## Asset Classes

Quant Bridge supports trading the following asset classes:

- [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)
- [Futures](https://www.quantconnect.com/docs/v2/writing-algorithms/securities/asset-classes/futures.md)

## Orders

Quant Bridge enables you to create and manage Bloomberg™ orders.

### Order Types

The following table describes the available order types for each asset class that Quant Bridge 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) |
| [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) |  |  |  |
| [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) |

### Order Properties

We model custom order properties from the Bloomberg EMSX API. The following table describes the members of the `QuantBridgeOrderProperties` 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` |
| `notes` | `str` | The free form instructions that may be sent to the broker. |  |
| `handling_instruction` | `str` | The instructions for handling the order or route. The values can be preconfigured or a value customized by the broker. |  |
| `custom_notes_1` | `str` | Custom user order notes 1. For more information about custom order notes, see [Custom Notes & Free Text Fields](https://emsx-api-doc.readthedocs.io/en/latest/programmable/description.html?highlight=Notes#custom-notes-free-text-fields) in the EMSX API documentation |  |
| `custom_notes_2` | `str` | Custom user order notes 2. |  |
| `custom_notes_3` | `str` | Custom user order notes 3. |  |
| `custom_notes_4` | `str` | Custom user order notes 4. |  |
| `custom_notes_5` | `str` | Custom user order notes 5. |  |
| `account` | `str` | The EMSX account. |  |
| `broker` | `str` | The EMSX broker code. |  |
| `locate_broker` | `str` | The EMSX locate broker code that identifies the counterparty the shares are borrowed from for a short equity sale (for example, `"BMTB"`). Maps to the `LocBrkr` field on the EMSX trading ticket. Setting this property (or `locate_id`) on a short equity sale causes the brokerage to emit `EMSX_LOCATE_REQ = "Y"` alongside. |  |
| `locate_id` | `str` | The EMSX locate confirmation/ticket Id that the lending broker returns. Maps to the `LocId` field on the EMSX trading ticket. |  |
| `is_cfd_trade` | `bool` | A flag that books the order as a contract for differences (CFD) instead of a regular trade. Maps to the `CFD` option of the `Booking Type` drop-down on the EMSX trading ticket and sets the `EMSX_CFD_FLAG` element. EMSX applies this flag at the order level, not per security. A regular trade is the EMSX default, so the brokerage only sends the element when you set this property to `True`. | `False` |
| `strategy` | `StrategyParameters` | An object that represents the EMSX order strategy details. You must append strategy parameters in the order that the EMSX API expects. The following strategy names are supported: "DMA", "DESK", "VWAP", "TWAP", "FLOAT", "HIDDEN", "VOLUMEINLINE", "CUSTOM", "TAP", "CUSTOM2", "WORKSTRIKE", "TAPNOW", "TIMED", "LIMITTICK", "STRIKE" |  |
| `execution_instruction` | `str` | The execution instruction field. |  |
| `automatic_position_sides` | `bool` | A flag that determines whether to automatically include the position side in the order direction (buy-to-open, sell-to-close, etc.) instead of the default (buy, sell). |  |
| `position_side` | `OrderPosition/NoneType` | An `OrderPosition` object that specifies the position side in the order direction (buy-to-open, sell-to-close, etc.) instead of the default (buy, sell). This member has precedence over `automatic_position_sides`. |  |
| `exchange` | `Exchange` | Defines the exchange name for sending the order to. |  |
| `additional_properties` | `BaseExtendedDictionary[str, str]` | The custom EMSX elements to send with the order. The key is the EMSX element name and the value is the element value. The other order properties take precedence, so an entry that targets an element they already set has no effect. The brokerage skips entries that the EMSX schema doesn't define instead of rejecting the order. | An empty dictionary |

```python
def initialize(self) -> None:
    # Set the default order properties
    self.default_order_properties = QuantBridgeOrderProperties()
    self.default_order_properties.time_in_force = TimeInForce.GOOD_TIL_CANCELED
    self.default_order_properties.strategy = QuantBridgeOrderProperties.StrategyParameters(
        "VWAP",
        [
            QuantBridgeOrderProperties.StrategyField("09:30:00"),
            QuantBridgeOrderProperties.StrategyField("10:30:00"),
            QuantBridgeOrderProperties.StrategyField(),
            QuantBridgeOrderProperties.StrategyField()
        ]
    )

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 = QuantBridgeOrderProperties()
    order_properties.time_in_force = TimeInForce.DAY
    order_properties.account = "account1"
    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.account = "account2"
    self.limit_order(self._symbol, quantity, limit_price, order_properties=order_properties)
```

The `additional_properties` dictionary lets you set EMSX elements that the preceding properties don't cover, without waiting for a new LEAN release. `is_cfd_trade` reads and writes the `EMSX_CFD_FLAG` entry of this dictionary, so setting either of them is equivalent. The following example books the orders as CFD trades and adds the odd lot element, which no dedicated property covers:

```python
def initialize(self) -> None:
    # Set the default order properties to book the orders as CFD trades and to flag them as odd lots
    order_properties = QuantBridgeOrderProperties()
    order_properties.is_cfd_trade = True
    order_properties.additional_properties["EMSX_ODD_LOT"] = "1"
    self.default_order_properties = order_properties
```

The dictionary starts empty and you can't replace it with a plain Python dictionary. To add several elements at once, call the `update` method with a dictionary. To remove all the elements, call the `clear` method.

For more information about the format that the Bloomberg EMSX API expects, see [Create Order and Route Extended Request](https://emsx-api-doc.readthedocs.io/en/latest/programmable/requestResponse.html#create-order-and-route-extended-request) in the EMSX API documentation and the [createOrderAndRouteWithStrat documentation](https://www.mathworks.com/help/datafeed/emsx.createorderandroutewithstrat.html) on the MathWorks website.

### Get Open Orders

Quant Bridge lets you [access open orders](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/transaction-manager.md).

### Monitor Fills

Quant Bridge allows you to monitor orders as they fill through [order events](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-events.md).

### Updates

Quant Bridge doesn't support [order updates](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/order-tickets.md#04-Update-Orders), but you can cancel an existing order and then create a new order with the desired arguments. 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).

### Cancellations

Quant Bridge enables you to [cancel open orders](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/order-tickets.md#05-Cancel-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

### Brokerage-Side Orders

By default, your algorithm doesn't record orders that you submit to your account by third-parties instead of through LEAN. To accept these orders, create a [custom brokerage message handler](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerage-message-handler.md).

## Fills

To view how we model fills in backtests, see [Fills](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/quantconnect-paper-trading.md#04-Fills).

## Slippage

To view how we model slippage in backtests, see [Slippage](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/quantconnect-paper-trading.md#05-Slippage).

## Fees

To view how we model fees in backtests, see [Fees](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/quantconnect-paper-trading.md#06-Fees).

## Buying Power

To view how we model buying power in backtests, see [Buying Power](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/quantconnect-paper-trading.md#07-Buying-Power).

## Settlement

To view how we model settlements in backtests, see [Settlement](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/quantconnect-paper-trading.md#08-Settlement).

## Margin Interest Rate

To view how we model margin interest rates in backtests, see [Margin Interest Rate](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/quantconnect-paper-trading.md#09-Margin-Interest-Rate).

## Default Markets

To view the default markets of each asset class when you use Quant Bridge, see [Default Markets](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/quantconnect-paper-trading.md#17-Default-Markets).

## Account Currency

The Quant Bridge brokerage 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).
