Skip to content

Commit

Permalink
Updates Create Live Algorithm
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexCatarino committed Jul 27, 2023
1 parent 808853f commit 67c3cb0
Show file tree
Hide file tree
Showing 3 changed files with 80 additions and 92 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,36 @@
</tr>
</thead>
<tr>
<td width="20%">projectId</td> <td> <code>integer</code> <br/> Project Id.</td>
<td width="20%">versionId</td> <td> <code>string<br/><i><sub>example: -1</sub></i></code> <br/> 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.</td>
</tr>
<tr>
<td width="20%">compileId</td> <td> <code>string</code> <br/> Compile Id.</td>
<td width="20%">projectId</td> <td> <code>integer</code> <br/> Project Id.</td>
</tr>
<tr>
<td width="20%">serverType</td> <td> <code>string</code> <br/> Type of server instance that will run the algorithm.</td>
<td width="20%">compileId</td> <td> <code>string</code> <br/> Compile Id.</td>
</tr>
<tr>
<td width="20%">baseLiveAlgorithmSettings</td> <td> <code>BaseLiveAlgorithmSettings object</code> <br/> Base class for settings that must be configured per Brokerage to create new algorithms via the API.</td>
<td width="20%">nodeId</td> <td> <code>string</code> <br/> Id of the node that will run the algorithm.</td>
</tr>
<tr>
<td width="20%">versionId</td> <td> <code>string<br/><i><sub>example: -1</sub></i></code> <br/> 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.</td>
<td width="20%">brokerage</td> <td> <code>BaseLiveAlgorithmSettings object</code> <br/> Base class for settings that must be configured per Brokerage to create new algorithms via the API.</td>
</tr>
<tr>
<td width="20%">Example</td>
<td>
<div class="cli section-example-container"><pre>
{
"versionId": "-1",
"projectId": 0,
"compileId": "string",
"serverType": "string",
"baseLiveAlgorithmSettings": {
"id": "string",
"user": "string",
"password": "string",
"nodeId": "string",
"brokerage": {
"id": "Default",
"user": "",
"password": "",
"environment": "live",
"account": "string"
},
"versionId": "-1"
"account": ""
}
}</pre>
</div>
</td>
Expand All @@ -50,49 +50,30 @@
</tr>
</thead>
<tr>
<td width="20%">id</td> <td> <code>string</code> <br/> 'Interactive' / 'FXCM' / 'Oanda' / 'Tradier' /'PaperTrading'.</td>
<td width="20%">id</td> <td> <code>string<br/><i><sub>example: Default</sub></i></code> <br/> 'Interactive' / 'FXCM' / 'Oanda' / 'Tradier' /'PaperTrading'.</td>
</tr>
<tr>
<td width="20%">user</td> <td> <code>string</code> <br/> Username associated with brokerage.</td>
<td width="20%">user</td> <td> <code>string<br/><i><sub>example: </sub></i></code> <br/> Username associated with brokerage.</td>
</tr>
<tr>
<td width="20%">password</td> <td> <code>string</code> <br/> Password associated with brokerage.</td>
<td width="20%">password</td> <td> <code>string<br/><i><sub>example: </sub></i></code> <br/> Password associated with brokerage.</td>
</tr>
<tr>
<td width="20%">environment</td> <td> <code>string Enum</code> <br/> Represents the types of environments supported by brokerages for trading. Options : ['live', 'paper']</td>
</tr>
<tr>
<td width="20%">account</td> <td> <code>string</code> <br/> Account of the associated brokerage.</td>
<td width="20%">account</td> <td> <code>string<br/><i><sub>example: </sub></i></code> <br/> Account of the associated brokerage.</td>
</tr>
<tr>
<td width="20%">Example</td>
<td>
<div class="cli section-example-container"><pre>
{
"id": "string",
"user": "string",
"password": "string",
"id": "Default",
"user": "",
"password": "",
"environment": "live",
"account": "string"
}</pre>
</div>
</td>
</tr>
</table><table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>BrokerageEnvironment</code> Model - Represents the types of environments supported by brokerages for trading.</th>
</tr>
</thead>
<tr>
<td width="20%">BrokerageEnvironment</td> <td> <code>string Enum</code> <br/> Represents the types of environments supported by brokerages for trading. Options : ['live', 'paper']</td>
</tr>
<tr>
<td width="20%">Example</td>
<td>
<div class="cli section-example-container"><pre>
{
"BrokerageEnvironment": "live"
"account": ""
}</pre>
</div>
</td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,32 +7,26 @@ <h4>200 Success</h4>
<table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>LiveAlgorithm</code> Model - Live algorithm instance result from the QuantConnect Rest API.</th>
<th colspan="2"><code>CreateLiveAlgorithmResponse</code> Model - Response received when deploying a live algorithm.</th>
</tr>
</thead>
<tr>
<td width="20%">projectId</td> <td> <code>integer</code> <br/> Project Id for the live instance.</td>
<td width="20%">responseCode</td> <td> <code>string<br/><i><sub>example: 200 OK</sub></i></code> <br/> Response code.</td>
</tr>
<tr>
<td width="20%">deployId</td> <td> <code>string</code> <br/> Unique live algorithm deployment identifier (similar to a backtest id).</td>
<td width="20%">versionId</td> <td> <code>string<br/><i><sub>example: 15753</sub></i></code> <br/> The version of the Lean used to run the algorithm.</td>
</tr>
<tr>
<td width="20%">status</td> <td> <code>string Enum</code> <br/> States of a live deployment. Options : ['DeployError', 'InQueue', 'Running', 'Stopped', 'Liquidated', 'Deleted', 'Completed', 'RuntimeError', 'Invalid', 'LoggingIn', 'Initializing', 'History']</td>
<td width="20%">projectId</td> <td> <code>integer</code> <br/> Project Id.</td>
</tr>
<tr>
<td width="20%">launched</td> <td> <code>string($date-time)</code> <br/> Datetime the algorithm was launched in UTC.</td>
<td width="20%">deployId</td> <td> <code>string</code> <br/> Deployment Id.</td>
</tr>
<tr>
<td width="20%">stopped</td> <td> <code>string($date-time)</code> <br/> Datetime the algorithm was stopped in UTC, null if its still running.</td>
<td width="20%">source</td> <td> <code>string<br/><i><sub>example: api-v2</sub></i></code> <br/> Id of the node that will run the algorithm.</td>
</tr>
<tr>
<td width="20%">brokerage</td> <td> <code>string Enum</code> <br/> Brokerage. Options : ['Interactive', 'FXCM', 'Oanda', 'Tradier', 'PaperTrading', 'Alpaca', 'Bitfinex', 'Binance', 'GDAX']</td>
</tr>
<tr>
<td width="20%">subscription</td> <td> <code>string</code> <br/> Chart we're subscribed to.</td>
</tr>
<tr>
<td width="20%">error</td> <td> <code>string</code> <br/> Live algorithm error message from a crash or algorithm runtime error.</td>
<td width="20%">queueHandler</td> <td> <code>string</code> <br/> /.</td>
</tr>
<tr>
<td width="20%">success</td> <td> <code>boolean</code> <br/> Indicate if the API request was successful.</td>
Expand All @@ -45,14 +39,12 @@ <h4>200 Success</h4>
<td>
<div class="cli section-example-container"><pre>
{
"responseCode": "200 OK",
"versionId": "15753",
"projectId": 0,
"deployId": "string",
"status": "DeployError",
"launched": "2021-11-26T15:18:27.693Z",
"stopped": "2021-11-26T15:18:27.693Z",
"brokerage": "Interactive",
"subscription": "string",
"error": "string",
"source": "api-v2",
"queueHandler": "string",
"success": true,
"errors": [
"string"
Expand All @@ -61,25 +53,6 @@ <h4>200 Success</h4>
</div>
</td>
</tr>
</table><table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>AlgorithmStatus</code> Model - States of a live deployment.</th>
</tr>
</thead>
<tr>
<td width="20%">AlgorithmStatus</td> <td> <code>string Enum</code> <br/> States of a live deployment. Options : ['DeployError', 'InQueue', 'Running', 'Stopped', 'Liquidated', 'Deleted', 'Completed', 'RuntimeError', 'Invalid', 'LoggingIn', 'Initializing', 'History']</td>
</tr>
<tr>
<td width="20%">Example</td>
<td>
<div class="cli section-example-container"><pre>
{
"AlgorithmStatus": "DeployError"
}</pre>
</div>
</td>
</tr>
</table><h4>401 Authentication Error</h4>
<table class="table qc-table">
<thead>
Expand Down
62 changes: 48 additions & 14 deletions QuantConnect-Platform-2.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ paths:
content:
application/json:
schema:
$ref: '#/components/schemas/LiveAlgorithm'
$ref: '#/components/schemas/CreateLiveAlgorithmResponse'
"401":
description: Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash.
headers:
Expand Down Expand Up @@ -1112,24 +1112,26 @@ components:
id:
type: string
description: '''Interactive'' / ''FXCM'' / ''Oanda'' / ''Tradier'' /''PaperTrading'''
example: "Default"
user:
type: string
description: Username associated with brokerage.
example: ""
password:
type: string
description: Password associated with brokerage.
example: ""
environment:
$ref: '#/components/schemas/BrokerageEnvironment'
type: string
description: Represents the types of environments supported by brokerages for trading.
enum:
- live
- paper
account:
type: string
description: Account of the associated brokerage.
example: ""
description: Base class for settings that must be configured per Brokerage to create new algorithms via the API.
BrokerageEnvironment:
type: string
description: Represents the types of environments supported by brokerages for trading.
enum:
- live
- paper
Cash:
type: object
properties:
Expand Down Expand Up @@ -1253,22 +1255,54 @@ components:
CreateLiveAlgorithmRequest:
type: object
properties:
versionId:
type: string
description: 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.
example: "-1"
projectId:
type: integer
description: Project Id.
compileId:
type: string
description: Compile Id.
serverType:
nodeId:
type: string
description: Type of server instance that will run the algorithm.
baseLiveAlgorithmSettings:
description: Id of the node that will run the algorithm.
brokerage:
$ref: '#/components/schemas/BaseLiveAlgorithmSettings'
description: Request to create a live algorithm.
CreateLiveAlgorithmResponse:
type: object
properties:
responseCode:
type: string
description: Response code
example: "200 OK"
versionId:
type: string
description: 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.
example: "-1"
description: Request to create a live algorithm.
description: The version of the Lean used to run the algorithm.
example: "15753"
projectId:
type: integer
description: Project Id.
deployId:
type: string
description: Deployment Id.
source:
type: string
description: Id of the node that will run the algorithm.
example: "api-v2"
queueHandler:
type: string
success:
type: boolean
description: Indicate if the API request was successful.
errors:
type: array
description: List of errors with the API call.
items:
type: string
description: Response received when deploying a live algorithm.
CreateProjectRequest:
type: object
properties:
Expand Down

0 comments on commit 67c3cb0

Please sign in to comment.