Live Management
Create 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 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 'Interactive' / 'FXCM' / 'Oanda' / 'Tradier' /'PaperTrading'. |
user | string Username associated with brokerage. |
password | string Password associated with brokerage. |
environment | string Enum Represents the types of environments supported by brokerages for trading. Options : ['live', 'paper'] |
account | string 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 Response code. |
versionId | string The version of the Lean used to run the algorithm. |
projectId | integer Project Id. |
deployId | string Deployment Id. |
source | string 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 |