---
title: "Bloomberg EMSX"
description: "Learn how to model and connect a live algorithm to Prime Brokerage in Lean CLI."
canonical: https://www.quantconnect.com/docs/v2/lean-cli/live-trading/brokerages/bloomberg-emsx
markdown: https://www.quantconnect.com/docs/v2/lean-cli/live-trading/brokerages/bloomberg-emsx.md
language: python
source: https://github.com/QuantConnect/Documentation/tree/master/05%20Lean%20CLI/09%20Live%20Trading/01%20Brokerages/17%20Bloomberg%20EMSX
modified: 2026-11-02
index: https://www.quantconnect.com/llms.txt
---

# Bloomberg EMSX

[Documentation](https://www.quantconnect.com/docs/v2.md) > [Lean CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) > Live Trading > [Brokerages](https://www.quantconnect.com/docs/v2/lean-cli/live-trading/brokerages.md) > Bloomberg EMSX

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

## Introduction

The Lean CLI supports live trading on your local machine or in QuantConnect Cloud, which makes the transfer from backtesting to live trading as seamless as possible. You must [log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) using your QuantConnect account to deply your algorithm on your local machine or in QuantConnect Cloud. This page contains instructions on how to start live trading with the Quant Bridge brokerage. If the [Lean Configuration file](https://www.quantconnect.com/docs/v2/lean-cli/initialization/configuration.md#03-Lean-Configuration) in your [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) contains values for some of the command options, the CLI skips some of the prompts.

The LEAN CLI integrates with the Bloomberg Desktop API (DAPI) to get data for research, backtests, optimization, and live trading or through your existing Bloomberg data subscriptions. In addition, you can route live trading strategies and and UAT paper trading through Bloomberg order routing via the EMSX network.

To use the CLI, you must be a member in an [organization](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/tier-features.md) on a paid tier.

## 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)

## Data Feeds

Quant Bridge with the LEAN CLI lets you source historical data from Bloomberg and save it onto your desktop computer for backtesting as within your license permissions from Bloomberg. The Bloomberg API includes up to six months of history in low resolutions like second and minute resolutions.

## Orders

Quant Bridge enables you to create and manage Bloomberg™ orders. You can also use the LEAN CLI with the Quant Bridge integration to test paper trading with LEAN. In this case, LEAN models order fills using the live tick data feed from Bloomberg™.

### Order Types

The following table describes the available order types for each asset class that Quant Bridge supports:

| Order Type | Equity | Equity Options | Futures |
| --- | --- | --- | --- |
| [MarketOrder](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) |
| [MarketOnOpenOrder](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) |  |  |
| [LimitOrder](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) |
| [StopMarketOrder](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) |
| [StopLimitOrder](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) |

### Time In Force

Quant Bridge supports the following [TimeInForce](https://www.quantconnect.com/docs/v2/writing-algorithms/trading-and-orders/order-properties.md#03-Time-In-Force) instructions:

- `DAY`
- `GOOD_TIL_CANCELED`
- `good_til_date`

### 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).

### 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

## Fees

Orders filled with Quant Bridge are subject to the fees of the Bloomberg™ Execution Management System and your prime brokerage destination. To view how we model their fees, see [Fees](https://www.quantconnect.com//docs/v2/writing-algorithms/reality-modeling/brokerages/supported-models/quantconnect-paper-trading#06-Fees).

## Historical Data

When LEAN taps into Bloomberg™ via Quant Bridge, it can run backtests and research notebooks with rich historical data sourced from the Bloomberg™ Terminal. LEAN provides accurate slippage, spread, and transaction fee models for realistic backtesting. All models are customizable to adapt to your strategy requirements. Historical data is cached locally in an efficient format for quick backtesting in the LEAN engine. If you request intraday historical data, you can request data from within the last 6 months. Historical open interest and custom data isn't available.

## Compliance

Bloomberg™ is not affiliated with QuantConnect, nor does it endorse Quant Bridge. QuantConnect requires a Trading Firm or Institutional license to use the Quant Bridge integration.

The following rules apply:

- All users of the integration must hold a Bloomberg License to be defined as an "Entitled User".
- All data accessed via the Bloomberg Desktop API must remain on the host computer. The Bloomberg Terminal and the LEAN instance must be on the same computer.

The following table shows the activities each of the Bloomberg technologies support:

| Technology | Research | Backtesting | Paper Trading | Live Trading |
| --- | --- | --- | --- | --- |
| Desktop API | ![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) |
| B.PIPE | ![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) |

## CLI Commands

Execute the [CLI](https://www.quantconnect.com/docs/v2/lean-cli.md) commands in the following sections to interact with Quant Bridge. If you need further assistance, see the [CLI Reference](https://www.quantconnect.com/docs/v2/lean-cli/api-reference.md).

### Run Local Backtests

Launch local backtests with data from the Bloomberg Terminal Desktop API. Lean automatically fetches the data required for your backtest.

```
$ lean backtest "<projectName>" --data-provider-historical "Quant Bridge"
```

### Launch Research Notebooks

Start Jupyter Research Notebooks, tapping into the entire QuantConnect API with the data sourced from a Bloomberg Terminal.

```
$ lean research "<projectName>" --data-provider-historical "Quant Bridge"
```

### Deploy Live Algorithms

Launch live trading algorithms to trade with any of the 1300+ routing destinations in the Bloomberg EMSX network.

```
$ lean live "<projectName>" --brokerage "Quant Bridge" --data-provider-live "Quant Bridge"
```

## Deploy Cloud Algorithms

You need to [set up the Bloomberg™ EMSX API Server](https://www.quantconnect.com/docs/v2/cloud-platform/live-trading/brokerages/bloomberg-emsx.md#11-Set-Up-EMSX-API-Server) before you can deploy cloud algorithms with Quant Bridge.

Follow these steps to start live trading a project in the cloud with the Quant Bridge brokerage and the Quant Bridge data provider:

1. [Log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) to the CLI if you haven't done so already.
2. Open a terminal in the [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) that contains the project.
3. Run `lean cloud live deploy "<projectName>" --push --open` to push `. / <projectName>`. to the cloud, start a live deployment wizard, and open the results in the browser once the deployment starts.
   ```
   $ lean cloud live deploy "My Project" --push --open
   [1/1] Pushing 'My Project'
   Successfully updated cloud file 'My Project/main.py'
   Started compiling project 'My Project'
   Successfully compiled project 'My Project'
   ```
4. Enter **10** to select the Quant Bridge brokerage.
   ```
   $ lean cloud live deploy "My Project" --push --open
   Select a brokerage:
   1) Paper Trading
   2) Interactive Brokers
   3) Tradier
   4) Oanda
   5) Bitfinex
   6) Coinbase Advanced Trade
   7) Binance
   8) Zerodha
   9) Samco
   10) Quant Bridge
   11) Trading Technologies
   12) Kraken
   13) Charles Schwab
   14) Bybit
   15) TradeStation
   16) Alpaca
   17) Tastytrade
   18) Eze
   19) dYdX
   20) Webull
   21) Public
   22) Clear Street
   Enter an option: 10
   ```
5. Enter your unique user identifier (UUID).
   ```
   $ lean cloud live "My Project" --push --open
   Configure credentials for Quant Bridge
   Using 'SAPI' Connection Type
   Server Auth ID:
   ```
   The UUID is a unique integer identifier that's assigned to each Bloomberg Anywhere user. If you don't know your UUID, contact Bloomberg.
6. Enter the environment to use.
   ```
   $ lean cloud live "My Project" --push --open
   Environment (Production, Beta):
   ```
7. Enter the EMSX API Server host and port.
   ```
   $ lean cloud live "My Project" --push --open
   Server host:
   Server port:
   ```
   The default port is 8194.
8. Enter the EMSX broker to use.
   ```
   $ lean cloud live "My Project" --push --open
   EMSX broker:
   ```
9. Enter the account to which LEAN should route orders.
   ```
   $ lean cloud live "My Project" --push --open
   EMSX account []:
   ```
10. Enter your OpenFIGI API key.
   ```
   $ lean cloud live "My Project" --push --open
   OpenFIGI API key:
   ```
11. Configure your notification settings.
   You can configure any combination of email, webhook, SMS, and Telegram notifications for order events and emitted insights. To view the number of notification you can send for free, see the [Live Trading Notification Quotas](https://www.quantconnect.com/docs/v2/cloud-platform/organizations/resources.md#13-Live-Trading-Notification-Quotas).
   ```
   $ lean cloud live deploy "My Project" --push --open
   Do you want to send notifications on order events? [y/N]: y
   Do you want to send notifications on insights? [y/N]: y
   Email notifications: None
   Webhook notifications: None
   SMS notifications: None
   Select a notification method:
   1) Email
   2) Webhook
   3) SMS
   4) Telegram
   Enter an option: 1
   Email address: john.doe@example.com
   Subject: Algorithm notification
   Email notifications: john.doe@example.com
   Webhook notifications: None
   SMS notifications: None
   Telegram notifications: None
   Do you want to add another notification method? [y/N]: n
   ```
12. Enable or disable automatic algorithm restarting.
   This feature attempts to restart your algorithm if it fails due to a runtime error, like a brokerage API disconnection.
   ```
   $ lean cloud live deploy "My Project" --push --open
   Do you want to enable automatic algorithm restarting? [Y/n]: y
   ```
13. Set your initial cash balance.
   ```
   $ lean cloud live deploy "My Project" --push --open
   Previous cash balance: [{'currency': 'USD', 'amount': 100000.0}]
   Do you want to set a different initial cash balance? [y/N]: y
   Setting initial cash balance...
   Currency: USD
   Amount: 95800
   Cash balance: [{'currency': 'USD', 'amount': 95800.0}]
   Do you want to add more currency? [y/N]: n
   ```
14. Set your initial portfolio holdings.
   ```
   $ lean cloud live deploy "My Project" --push --open
   Do you want to set the initial portfolio holdings? [y/N]: y
   Do you want to use the last portfolio holdings? [] [y/N]: n
   Setting custom initial portfolio holdings...
   Symbol: GOOG
   Symbol ID: GOOCV VP83T1ZUHROL
   Quantity: 10
   Average Price: 50
   Portfolio Holdings: [{'symbol': 'GOOG', 'symbolId': 'GOOCV VP83T1ZUHROL', 'quantity': 10, 'averagePrice': 50.0}]
   Do you want to add more holdings? [y/N]: n
   ```
15. Select the live node that you want to use.
   If you only have one idle live trading node, it is selected automatically and this step is skipped.
   ```
   $ lean cloud live deploy "My Project" --push --open
   Select a node:
   1) L-MICRO node 89c90172 - 1 CPU @ 2.4GHz, 0.5GB Ram
   2) L-MICRO node 85a52135 - 1 CPU @ 2.4GHz, 0.5GB Ram
   Enter an option: 1
   ```
16. Enter **10** to select the Quant Bridge data provider.
   ```
   $ lean live "My Project"
   Select a live data feed:
   1) QuantConnect
   2) Interactive Brokers
   3) Tradier
   4) Oanda
   5) Bitfinex
   6) Coinbase Advanced Trade
   7) Binance
   8) Zerodha
   9) Samco
   10) Quant Bridge
   11) Trading Technologies
   12) Kraken
   13) Charles Schwab
   14) Polygon
   15) CoinApi
   16) Bybit
   17) TradeStation
   18) Alpaca
   19) Tastytrade
   20) Eze
   21) dYdX
   22) DataBento
   To enter multiple options, separate them with comma: 10
   ```
   If you select one of the following data providers, see the respective page for more instructions:
- [Polygon](https://www.quantconnect.com/docs/v2/lean-cli/live-trading/data-providers/polygon.md)
- Verify the configured settings and confirm them to start the live deployment in the cloud.

```
$ lean cloud live deploy "My Project" --push --open
Brokerage: Quant Bridge
Project id: 1234567
Environment: Live
Server name: L-MICRO node 89c90172
Server type: L-MICRO
Live Data providers: Quant Bridge
LEAN version: 11157
Order event notifications: Yes
Insight notifications: Yes
Email notifications: john.doe@example.com
Webhook notifications: None
SMS notifications: None
Telegram notifications: None
Initial live cash balance: [{'currency': 'USD', 'amount': 95800.0}]
Initial live portfolio holdings: [{'symbol': 'GOOG', 'symbolId': 'GOOCV VP83T1ZUHROL', 'quantity': 10, 'averagePrice': 50.0}]
Automatic algorithm restarting: Yes
Are you sure you want to start live trading for project 'My Project'? [y/N]: y
```

- Inspect the result in the browser, which opens automatically after the deployment starts.

Follow these steps to see the live status of a project:

1. [Log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) to the CLI if you haven't done so already.
2. Open a terminal in the [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) that contains the project.
3. Run `lean cloud status "<projectName>"` to show the status of the cloud project named "<projectName>".
   ```
   $ lean cloud status "My Project"
   Project id: 1234567
   Project name: My Project
   Project url: https://www.quantconnect.com/project/1234567
   Live status: Running
   Live id: L-1234567a8901d234e5e678ddd9b0123c
   Live url: https://www.quantconnect.com/project/1234567/live
   Brokerage: Quant Bridge
   Launched: 2021-06-09 15:10:12 UTC
   ```

## Deploy Local Algorithms

You need to [install the Bloomberg Terminal and the BBComm component](https://www.bloomberg.com/professional/support/software-updates/) from the Bloomberg website before you can deploy local algorithms with Quant Bridge.

Follow these steps to start local live trading with the Quant Bridge brokerage:

1. [Log in](https://www.quantconnect.com/docs/v2/lean-cli/initialization/authentication.md#02-Log-In) to the CLI if you haven't done so already.
2. Open a terminal in the [organization workspace](https://www.quantconnect.com/docs/v2/lean-cli/initialization/organization-workspaces.md) that contains the project.
3. If your algorithm trades US Equities, Options, or Futures, [purchase and download](https://www.quantconnect.com/docs/v2/lean-cli/datasets/quantconnect.md) the QuantConnect datasets that LEAN uses for the asset class. Crypto, Forex, and CFD algorithms can skip this step. The following table shows the datasets for each asset class:

   | Asset Class | Datasets |
   | --- | --- |
   | US Equity | [US Equity Security Master](https://www.quantconnect.com/datasets/quantconnect-us-equity-security-master/cli), to get adjusted prices. Without it, your algorithm uses raw prices. |
   | US Equity Options | [US Equity Security Master](https://www.quantconnect.com/datasets/quantconnect-us-equity-security-master/cli) and [US Equity Option Universe](https://www.quantconnect.com/datasets/quantconnect-us-equity-option-universe) |
   | US Index Options | [US Index Option Universe](https://www.quantconnect.com/datasets/quantconnect-us-index-option-universe) |
   | US Futures | [US Futures Security Master](https://www.quantconnect.com/datasets/quantconnect-us-futures-security-master/cli) and [US Future Universe](https://www.quantconnect.com/datasets/quantconnect-us-future-universe) |
   | US Future Options | [US Futures Security Master](https://www.quantconnect.com/datasets/quantconnect-us-futures-security-master/cli), [US Future Universe](https://www.quantconnect.com/datasets/quantconnect-us-future-universe), and [US Future Option Universe](https://www.quantconnect.com/datasets/quantconnect-us-future-option-universe). To get access, [contact us](https://www.quantconnect.com/contact). |

   If your algorithm uses [universe selection](https://www.quantconnect.com/docs/v2/writing-algorithms/universes/key-concepts.md), also download the universe dataset, such as the [US Equity Coarse Universe](https://www.quantconnect.com/docs/v2/lean-cli/datasets/quantconnect/us-equity-coarse-fundamental.md) or [US ETF Constituents](https://www.quantconnect.com/docs/v2/lean-cli/datasets/quantconnect/us-etf-constituents.md).
4. Run `lean live deploy "<projectName>"` to start a live deployment wizard for the project in `. / <projectName>` and then enter the brokerage number, **10**.

   ```
   $ lean live deploy "My Project"
   Select a brokerage:
   1) Paper Trading
   2) Interactive Brokers
   3) Tradier
   4) OANDA
   5) Bitfinex
   6) Coinbase Advanced Trade
   7) Binance
   8) Zerodha
   9) Samco
   10) Quant Bridge
   11) Trading Technologies
   12) Kraken
   13) Charles Schwab
   14) Bybit
   15) TradeStation
   16) Alpaca
   17) Tastytrade
   18) Eze
   19) dYdX
   20) Webull
   21) Public
   22) Clear Street
   ```
5. Enter the environment to use.

   ```
   $ lean live "My Project"
   Environment (Production, Beta): Production
   ```
6. Enter the host and port of the Bloomberg server.

   ```
   $ lean live "My Project"
   Server host: 127.0.0.1
   Server port: 8194
   ```
7. Enter your EMSX configuration

   ```
   $ lean live "My Project"
   EMSX broker: someValue
   EMSX account:
   ```
8. Enter your Open FIGI API key.

   ```
   $ lean live "My Project"
   Open FIGI API key:
   ```
9. Enter **9** to select the Quant Bridge live data provider.

   ```
   $ lean live deploy "My Project"
   Select a live data provider:
   1) Interactive Brokers
   2) Tradier
   3) Oanda
   4) Bitfinex
   5) Coinbase Advanced Trade
   6) Binance
   7) Zerodha
   8) Samco
   9) Quant Bridge
   10) Trading Technologies
   11) Kraken
   12) Charles Schwab
   13) IQFeed
   14) Polygon
   15) CoinApi
   16) ThetaData
   17) Custom data only
   18) Bybit
   19) TradeStation
   20) Alpaca
   21) Tastytrade
   22) Eze
   23) dYdX
   24) DataBento
   To enter multiple options, separate them with comma: 9
   ```
10. View the result in the `<projectName> / live / <timestamp>` directory. Results are stored in real-time in JSON format. You can save results to a different directory by providing the `--output <path>` option in step 4.

If you already have a live environment configured in your [Lean configuration file](https://www.quantconnect.com/docs/v2/lean-cli/initialization/configuration.md#03-Lean-Configuration), you can skip the interactive wizard by providing the `--environment <value>` option in step 4. The value of this option must be the name of an environment which has `live-mode` set to `true`.
