Live Management

Create Live Algorithm

Introduction

Create a live algorithm.

Request

Project, compile and brokerage login information for deploying a live algorithm. The /live/create API accepts requests in the following format:

CreateLiveAlgorithmRequest Model - Request to create a live algorithm.
versionId string
example: -1

The version of the Lean used to run the algorithm. -1 is master, however, sometimes this can create problems with live deployments. If you experience problems using, try specifying the version of Lean you would like to use.
projectId integer
Project Id.
compileId string
Compile Id.
nodeId string
Id of the node that will run the algorithm.
brokerage BaseLiveAlgorithmSettings object
Base class for settings that must be configured per Brokerage to create new algorithms via the API.
Example
{
  "versionId": "-1",
  "projectId": 0,
  "compileId": "string",
  "nodeId": "string",
  "brokerage": {
    "id": "Default",
    "user": "",
    "password": "",
    "environment": "live",
    "account": ""
  }
}
BaseLiveAlgorithmSettings Model - Base class for settings that must be configured per Brokerage to create new algorithms via the API.
id string
example: Default

'Interactive' / 'FXCM' / 'Oanda' / 'Tradier' /'PaperTrading'.
user string
example:

Username associated with brokerage.
password string
example:

Password associated with brokerage.
environment string Enum
Represents the types of environments supported by brokerages for trading. Options : ['live', 'paper']
account string
example:

Account of the associated brokerage.
Example
{
  "id": "Default",
  "user": "",
  "password": "",
  "environment": "live",
  "account": ""
}

Responses

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

200 Success

CreateLiveAlgorithmResponse Model - Response received when deploying a live algorithm.
responseCode string
example: 200 OK

Response code.
versionId string
example: 15753

The version of the Lean used to run the algorithm.
projectId integer
Project Id.
deployId string
Deployment Id.
source string
example: api-v2

Id of the node that will run the algorithm.
queueHandler string
/.
success boolean
Indicate if the API request was successful.
errors string Array
List of errors with the API call.
Example
{
  "responseCode": "200 OK",
  "versionId": "15753",
  "projectId": 0,
  "deployId": "string",
  "source": "api-v2",
  "queueHandler": "string",
  "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: