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

# Bloomberg FIX

[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) > Bloomberg FIX

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

## Introduction

This page explains the `BloombergFixBrokerageModel`, 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.BLOOMBERG_FIX, AccountType.MARGIN)
```

The `BloombergFixBrokerageModel` only supports margin accounts. If you pass `AccountType.CASH`, it throws an exception.

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

## Asset Classes

The `BloombergFixBrokerageModel` 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)
- [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

The `BloombergFixBrokerageModel` supports six order types and order updates.

### Order Types

The following table describes the available order types for each asset class that the `BloombergFixBrokerageModel` 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) | ![green check](https://cdn.quantconnect.com/i/tu/check.png) | ![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) | ![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) |

Market on open orders are unavailable for Futures. If you place one, the order is invalid.

### Updates

The `BloombergFixBrokerageModel` supports [order updates](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-management/order-tickets.md#04-Update-Orders). The Bloomberg™ FixNet HUB accepts cancel/replace requests (FIX tag 35=G), so you can update the quantity, limit price, stop price, order type, and time in force of an open order.

### Order Properties

The `BloombergFixBrokerageModel` supports custom order properties. The `BloombergFixOrderProperties` class inherits the `FixOrderProperties` class that every [FIX connection](https://www.quantconnect.com/docs/v2/cloud-platform/live-trading/brokerages/fix-connections.md) shares. The following table describes the members of the `BloombergFixOrderProperties` 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. | `TimeInForce.GOOD_TIL_CANCELED` |
| `handle_instruction` | `str/NoneType` | The instruction for order handling on the broker floor. The following values are supported: `FixOrderProperties.AUTOMATED_EXECUTION_ORDER_PRIVATE`: Automated execution order, private, no broker intervention `FixOrderProperties.AUTOMATED_EXECUTION_ORDER_PUBLIC`: Automated execution order, public, broker intervention OK `FixOrderProperties.MANUAL_ORDER`: Staged order, broker intervention required |  |
| `notes` | `str` | The free form text instructions that may be sent to the broker. |  |
| `locate_broker` | `str` | The broker that the shares are borrowed from for a short sale. Reads and writes the `LocateBroker` FIX tag 5700. |  |
| `locate_reqd` | `str` | Whether a locate is required for the short sale, `"Y"` or `"N"`. Reads and writes the `LocateReqd` FIX tag 114. |  |
| `automatic_position_sides` | `bool` | A flag that determines whether to set the position side of the order (buy-to-open, sell-to-close, etc.) from your current holdings. If you disable it, the order is a plain buy or sell without FIX tag 77. | `True` |
| `position_side` | `OrderPosition/NoneType` | An `OrderPosition` object that specifies the position side of the order (buy-to-open, sell-to-close, etc.) instead of your current holdings. This member has precedence over `automatic_position_sides`. |  |
| `additional_properties` | `BaseExtendedDictionary[str, str]` | The custom FIX tags to send with the order. The key is the FIX tag number and the value is the tag value. | An empty dictionary |

```python
def initialize(self) -> None:
    # Set the default order properties to borrow the shares of short sales from a specific broker
    self.default_order_properties = BloombergFixOrderProperties()
    self.default_order_properties.time_in_force = TimeInForce.GOOD_TIL_CANCELED
    self.default_order_properties.locate_broker = "BMTB"
    self.default_order_properties.locate_reqd = "Y"
```

The position side of an order sets the FIX Side tag 54 and the OpenClose tag 77. The following table shows the tag values for each position side:

| Position Side | Tag 54 | Tag 77 |
| --- | --- | --- |
| `OrderPosition.BUY_TO_OPEN` | `1` (buy) | `O` (open) |
| `OrderPosition.BUY_TO_CLOSE` | `1` (buy) | `C` (close) |
| `OrderPosition.SELL_TO_OPEN` | `5` (sell short) | `O` (open) |
| `OrderPosition.SELL_TO_CLOSE` | `2` (sell) | `C` (close) |

Tag 77 separates a buy that covers a short position from a buy that opens a long position, since both orders carry 54=1. Order updates and cancellations send the same tag values as the original order. To set the position side yourself instead of using your current holdings, set the `position_side` property:

```python
# Mark the buy as a buy to cover (tag 77 = C)
order_properties = BloombergFixOrderProperties()
order_properties.position_side = OrderPosition.BUY_TO_CLOSE
self.market_order("SPY", 100, order_properties=order_properties)
```

Your FIX counterparty may require tags that the preceding properties don't cover. To send them with your orders, add them to the `additional_properties` dictionary. For example, the following code marks the orders as direct market access (DMA) with tag 9301:

```python
def initialize(self) -> None:
    # Set the default order properties to mark orders as direct market access (DMA)
    order_properties = BloombergFixOrderProperties()
    order_properties.additional_properties["9301"] = "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 tags at once, call the `update` method with a dictionary. To remove all the tags, call the `clear` method.

### 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 `BloombergFixBrokerageModel` 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) |
| `Future` | [FutureFillModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/supported-models/future-model.md) |
| `Option` and `IndexOption` | [ImmediateFillModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/trade-fills/supported-models/immediate-model.md) |

## Slippage

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

## Fees

The `BloombergFixBrokerageModel` uses the [InteractiveBrokersFeeModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/transaction-fees/supported-models.md#13-Interactive-Brokers-Model) for Equity, Equity Option, and Future assets and the [ConstantFeeModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/transaction-fees/supported-models.md#02-Constant-Model) with no fees for Index Option assets.

```python
# For Equity, Equity Option, and Future assets:
security.set_fee_model(InteractiveBrokersFeeModel())

# For Index Option assets:
security.set_fee_model(ConstantFeeModel(0))
```

The fees that your prime brokerage destination charges may differ. To model them, [set a fee model](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/transaction-fees/key-concepts.md#02-Set-Models).

## Buying Power

The following table shows the [buying power model](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/buying-power.md#07-Supported-Models) that the `BloombergFixBrokerageModel` uses for each `SecurityType`:

| `SecurityType` | Buying Power Model |
| --- | --- |
| `Equity` | `SecurityMarginModel` with up to 2x leverage |
| `Option` and `IndexOption` | `OptionMarginModel` |
| `Future` | `FutureMarginModel` |

## Settlement

The `BloombergFixBrokerageModel` uses the [FutureSettlementModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/supported-models.md#05-Future-Model) for Future assets and the [ImmediateSettlementModel](https://www.quantconnect.com/docs/v2/writing-algorithms/reality-modeling/settlement/supported-models.md#02-Immediate-Model) for the remaining asset classes.

```python
# For Future assets:
security.set_settlement_model(FutureSettlementModel())

# For the remaining asset classes:
security.set_settlement_model(ImmediateSettlementModel())
```

## Margin Interest Rate

The `BloombergFixBrokerageModel` 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 `BloombergFixBrokerageModel`:

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

## Account Currency

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