book
Checkout our new book! Hands on AI Trading with Python, QuantConnect, and AWS Learn More arrow

Live Commands

Broadcast Live Command

Introduction

Broadcast a live command to all live algorithms in the organization.

Request

Broadcasts a command to all live deployments in the organization. The /live/commands/broadcast API accepts requests in the following format:

BroadcastLiveCommandRequest Model - Request to create a live command.
organizationId string
example: 5cad178b20a1d52567b534553413b691

Organization Id of the projects we would like to broadcast the command to.
excludeProjectId integer
example: 19626262

Project for the live instance we want to exclude from the broadcast list. If null, all projects will be included.
command object
example: {'$type': 'OrderCommand', 'symbol': {'id': 'BTCUSD 2XR', 'value': 'BTCUSD'}, 'order_type': 'market', 'quantity': '0.1', 'limit_price': 0, 'stop_price': 0, 'tag': ''}

The command to run.
Example
{
  "organizationId": "5cad178b20a1d52567b534553413b691",
  "excludeProjectId": 19626262,
  "command": {
    "$type": "OrderCommand",
    "symbol": {
        "id": "BTCUSD 2XR",
        "value": "BTCUSD"
    },
    "order_type": "market",
    "quantity": "0.1",
    "limit_price": 0,
    "stop_price": 0,
    "tag": ""
}
}

Responses

The /live/commands/broadcast API provides a response in the following format:

200 Success

RestResponse Model - Base API response class for the QuantConnect API.
success boolean
Indicate if the API request was successful.
errors string Array
List of errors with the API call.
Example
{
  "success": true,
  "errors": [
    "string"
  ]
}

401 Authentication Error

UnauthorizedError Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash.
www_authenticate string
Header

You can also see our Videos. You can also get in touch with us via Discord.

Did you find this page helpful?

Contribute to the documentation: