Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions 01 Cloud Platform/10 Live Trading/07 Results/10 Trades.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?php
$pageName = "live";
include(DOCS_RESOURCES."/algorithm-results/trades.php");
?>
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
"04" : "",
"05" : "",
"06" : "",
"07" : ""
"07" : "",
"08" : "",
"09" : ""
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</tr>
</thead>
<tr>
<td width="20%">algorithmId</td> <td> <code>string<br/><i><sub>example: L-6e9d8a78f5af89d401f630585be90e43</sub></i></code> <br/> Deploy Id (Algorithm Id) of the live running algorithm.</td>
<td width="20%">deployId</td> <td> <code>string<br/><i><sub>example: L-6e9d8a78f5af89d401f630585be90e43</sub></i></code> <br/> Deploy Id of the live algorithm. When you provide it, the response contains the orders of that deployment. When you omit it, the response contains the orders of every deployment of the project.</td>
</tr>
<tr>
<td width="20%">start</td> <td> <code>integer<br/><i><sub>required</sub></i><br/><i><sub>example: 0</sub></i></code> <br/> Starting index of the orders to be fetched.</td>
Expand All @@ -25,7 +25,7 @@
<td>
<div class="cli section-example-container"><pre>
{
"algorithmId": "L-6e9d8a78f5af89d401f630585be90e43",
"deployId": "L-6e9d8a78f5af89d401f630585be90e43",
"start": 0,
"end": 100,
"projectId": 23456789
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Code generated by API-Reference-Code-Generator.py -->

<p>
Download the orders of all the live deployments of a project as a CSV file.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Code generated by API-Reference-Code-Generator.py -->

<p>
The CSV file has the same format as the file you get when you click <span class='button-name'>Download Orders</span> on the live results page. The response contains at most 750 days of orders. If the date range is longer, the response contains the last 750 days of the range. To get older orders, call the endpoint again with an earlier <code>end</code> or call the <a href='/docs/v2/cloud-platform/api-reference/live-management/read-live-algorithm/orders'>/live/orders/read</a> endpoint. The response can contain orders outside of the date range. To get an exact range, filter the rows by their <code>Time</code> value.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<!-- Code generated by API-Reference-Code-Generator.py -->
<p>
Download the orders of a project for the date range provided. The <code>/live/export/orders</code> API accepts requests in the following format:
</p>
<table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>ExportLiveOrdersRequest</code> Model - Request to download the orders of the live deployments of a project.</th>
</tr>
</thead>
<tr>
<td width="20%">projectId</td> <td> <code>integer<br/><i><sub>required</sub></i><br/><i><sub>example: 23456789</sub></i></code> <br/> Id of the project from which to download the orders.</td>
</tr>
<tr>
<td width="20%">start</td> <td> <code>integer<br/><i><sub>example: 1727222400</sub></i></code> <br/> Start of the date range in Unix time (seconds). The default value is one hour before the first deployment of the project.</td>
</tr>
<tr>
<td width="20%">end</td> <td> <code>integer<br/><i><sub>example: 1792022400</sub></i></code> <br/> End of the date range in Unix time (seconds). The default value is the current time.</td>
</tr>
<tr>
<td width="20%">Example</td>
<td>
<div class="cli section-example-container"><pre>
{
"projectId": 23456789,
"start": 1727222400,
"end": 1792022400
}</pre>
</div>
</td>
</tr>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- Code generated by API-Reference-Code-Generator.py -->

<p>
The <code>/live/export/orders</code> API provides a response in the following format:
</p>
<h4>200 Success</h4>
<table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>text/csv</code> - Orders of the live deployments of the project, sorted by time.</th>
</tr>
</thead>
<tr>
<td width="20%">content</td> <td> <code>string</code> <br/> One row per order. The Time column is in UTC.</td>
</tr>
<tr>
<td width="20%">Example</td>
<td>
<div class="cli section-example-container"><pre>
Deploy,Time,Symbol,Price,Quantity,Type,Status,Value,Tag
L-6e9d8a78f5af89d401f630585be90e43,2026-10-08T14:20:04.8005773Z,SPY,672.35,10,"Market","Filled",6723.5,"" </pre>
</div>
</td>
</tr>
</table>
<h4>401 Authentication Error</h4>
<table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>UnauthorizedError</code> Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash.</th>
</tr>
</thead>
<tr>
<td width="20%">www_authenticate</td> <td> <code>string</code> <br/> Header</td>
</tr>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<? include(DOCS_RESOURCES."/qc-api/examples/live-management.php");?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "metadata",
"values": {
"description": "Download the orders of all the live deployments of a project as a CSV file.",
"keywords": "api, live trading, export orders, csv, live management",
"og:description": "Download the orders of all the live deployments of a project as a CSV file.",
"og:title": "Export Orders - Documentation QuantConnect.com",
"og:type": "website",
"og:site_name": "Export Orders - QuantConnect.com",
"og:image": "https://cdn.quantconnect.com/docs/i/cloud-platform/api-reference/live-management/read-live-algorithm/export-orders.png"
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Code generated by API-Reference-Code-Generator.py -->

<p>
Download the closed trades of all the live deployments of a project as a CSV file.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- Code generated by API-Reference-Code-Generator.py -->

<p>
The CSV file contains the closed trades that the <a href='/docs/v2/cloud-platform/api-reference/live-management/read-live-algorithm/trades'>/live/trades/read</a> endpoint returns for the project. The response contains the trades with an entry time at or after <code>start</code>.
</p>
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!-- Code generated by API-Reference-Code-Generator.py -->
<p>
Download the closed trades of a project from the start time provided. The <code>/live/export/trades</code> API accepts requests in the following format:
</p>
<table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>ExportLiveTradesRequest</code> Model - Request to download the closed trades of the live deployments of a project.</th>
</tr>
</thead>
<tr>
<td width="20%">projectId</td> <td> <code>integer<br/><i><sub>required</sub></i><br/><i><sub>example: 23456789</sub></i></code> <br/> Id of the project from which to download the closed trades.</td>
</tr>
<tr>
<td width="20%">start</td> <td> <code>integer<br/><i><sub>example: 1727222400</sub></i></code> <br/> Earliest entry time of the trades in Unix time (seconds). The default value is one hour before the first deployment of the project.</td>
</tr>
<tr>
<td width="20%">Example</td>
<td>
<div class="cli section-example-container"><pre>
{
"projectId": 23456789,
"start": 1727222400
}</pre>
</div>
</td>
</tr>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
<!-- Code generated by API-Reference-Code-Generator.py -->

<p>
The <code>/live/export/trades</code> API provides a response in the following format:
</p>
<h4>200 Success</h4>
<table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>text/csv</code> - Closed trades of the live deployments of the project.</th>
</tr>
</thead>
<tr>
<td width="20%">content</td> <td> <code>string</code> <br/> One row per closed trade. The Entry Time and Exit Time columns are in UTC.</td>
</tr>
<tr>
<td width="20%">Example</td>
<td>
<div class="cli section-example-container"><pre>
Entry Time,Symbols,Exit Time,Direction,Entry Price,Exit Price,Quantity,P&amp;L,Fees,MAE,MFE,Drawdown,IsWin,Order Ids
2026-10-09T14:17:04.8008663Z,"SPY",2026-10-09T18:06:03.8005312Z,Buy,670.08,672.61,10,25.3,2,-8.9,25.3,8.9,1," 276,308" </pre>
</div>
</td>
</tr>
</table>
<h4>401 Authentication Error</h4>
<table class="table qc-table">
<thead>
<tr>
<th colspan="2"><code>UnauthorizedError</code> Model - Unauthorized response from the API. Key is missing, invalid, or timestamp is too old for hash.</th>
</tr>
</thead>
<tr>
<td width="20%">www_authenticate</td> <td> <code>string</code> <br/> Header</td>
</tr>
</table>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<? include(DOCS_RESOURCES."/qc-api/examples/live-management.php");?>
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"type": "metadata",
"values": {
"description": "Download the closed trades of all the live deployments of a project as a CSV file.",
"keywords": "api, live trading, export trades, csv, live management",
"og:description": "Download the closed trades of all the live deployments of a project as a CSV file.",
"og:title": "Export Trades - Documentation QuantConnect.com",
"og:type": "website",
"og:site_name": "Export Trades - QuantConnect.com",
"og:image": "https://cdn.quantconnect.com/docs/i/cloud-platform/api-reference/live-management/read-live-algorithm/export-trades.png"
}
}
104 changes: 102 additions & 2 deletions QuantConnect-Platform-2.0.0.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1039,6 +1039,66 @@ paths:
"401":
$ref: '#/components/responses/UnauthorizedErrorResponse'
operationId: readLiveAlgorithmTrades
/live/export/orders:
post:
tags:
- 01 Cloud Platform
- 99 API Reference
- 07 Live Management
- 02 Read Live Algorithm
- 08 Export Orders
summary: Download the orders of all the live deployments of a project as a CSV file.
description: "The CSV file has the same format as the file you get when you click <span class='button-name'>Download Orders</span> on the live results page. The response contains at most 750 days of orders. If the date range is longer, the response contains the last 750 days of the range. To get older orders, call the endpoint again with an earlier <code>end</code> or call the <a href='/docs/v2/cloud-platform/api-reference/live-management/read-live-algorithm/orders'>/live/orders/read</a> endpoint. The response can contain orders outside of the date range. To get an exact range, filter the rows by their <code>Time</code> value."
requestBody:
description: Download the orders of a project for the date range provided.
content:
application/json:
schema:
$ref: '#/components/schemas/ExportLiveOrdersRequest'
required: true
responses:
"200":
description: Orders of the live deployments of the project, sorted by time.
content:
text/csv:
schema:
type: string
description: "One row per order. The Time column is in UTC."
examples:
- "Deploy,Time,Symbol,Price,Quantity,Type,Status,Value,Tag\nL-6e9d8a78f5af89d401f630585be90e43,2026-10-08T14:20:04.8005773Z,SPY,672.35,10,\"Market\",\"Filled\",6723.5,\"\" "
"401":
$ref: '#/components/responses/UnauthorizedErrorResponse'
operationId: exportLiveAlgorithmOrders
/live/export/trades:
post:
tags:
- 01 Cloud Platform
- 99 API Reference
- 07 Live Management
- 02 Read Live Algorithm
- 09 Export Trades
summary: Download the closed trades of all the live deployments of a project as a CSV file.
description: "The CSV file contains the closed trades that the <a href='/docs/v2/cloud-platform/api-reference/live-management/read-live-algorithm/trades'>/live/trades/read</a> endpoint returns for the project. The response contains the trades with an entry time at or after <code>start</code>."
requestBody:
description: Download the closed trades of a project from the start time provided.
content:
application/json:
schema:
$ref: '#/components/schemas/ExportLiveTradesRequest'
required: true
responses:
"200":
description: Closed trades of the live deployments of the project.
content:
text/csv:
schema:
type: string
description: "One row per closed trade. The Entry Time and Exit Time columns are in UTC."
examples:
- "Entry Time,Symbols,Exit Time,Direction,Entry Price,Exit Price,Quantity,P&L,Fees,MAE,MFE,Drawdown,IsWin,Order Ids\n2026-10-09T14:17:04.8008663Z,\"SPY\",2026-10-09T18:06:03.8005312Z,Buy,670.08,672.61,10,25.3,2,-8.9,25.3,8.9,1,\"\t276,308\" "
"401":
$ref: '#/components/responses/UnauthorizedErrorResponse'
operationId: exportLiveAlgorithmTrades
/live/insights/read:
post:
tags:
Expand Down Expand Up @@ -6981,11 +7041,14 @@ components:
- projectId
type: object
properties:
algorithmId:
deployId:
type: string
description: Deploy Id (Algorithm Id) of the live running algorithm.
examples:
- L-6e9d8a78f5af89d401f630585be90e43
description: >-
Deploy Id of the live algorithm. When you provide it, the response contains the orders
of that deployment. When you omit it, the response contains the orders of every
deployment of the project.
start:
type: integer
examples:
Expand All @@ -7002,6 +7065,43 @@ components:
- 23456789
description: Id of the project from which to read the live algorithm.
description: Request to read orders from a live algorithm.
ExportLiveOrdersRequest:
required:
- projectId
type: object
properties:
projectId:
type: integer
examples:
- 23456789
description: Id of the project from which to download the orders.
start:
type: integer
examples:
- 1727222400
description: Start of the date range in Unix time (seconds). The default value is one hour before the first deployment of the project.
end:
type: integer
examples:
- 1792022400
description: End of the date range in Unix time (seconds). The default value is the current time.
description: Request to download the orders of the live deployments of a project.
ExportLiveTradesRequest:
required:
- projectId
type: object
properties:
projectId:
type: integer
examples:
- 23456789
description: Id of the project from which to download the closed trades.
start:
type: integer
examples:
- 1727222400
description: Earliest entry time of the trades in Unix time (seconds). The default value is one hour before the first deployment of the project.
description: Request to download the closed trades of the live deployments of a project.
ReadLiveTradesRequest:
required:
- start
Expand Down
2 changes: 1 addition & 1 deletion Resources/algorithm-results/orders.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
<p>The timestamps in the Order Summary table are based in Eastern Time (ET).</p>

<h4>Access the Order Summary CSV</h4>
<p>To view the orders data in CSV format, open the <?=$pageName?> results page, click the <span class='tab-name'>Orders</span> tab, and then click <span class='button-name'>Download Orders</span>. The content of the CSV file is the content displayed in the Orders Summary table when the table rows are collapsed. The timestamps in the CSV file are based in Coordinated Universal Time (UTC). <? if ($pageName == "live") { ?>The CSV file only contains the orders from the last 750 days. To get older orders, call the <a href='/docs/v2/research-environment/meta-analysis/live-analysis#03-Plot-Order-Fills'><span class='csharp'>ReadLiveOrders</span><span class='python'>read_live_orders</span></a> method or the <a href='/docs/v2/cloud-platform/api-reference/live-management/read-live-algorithm/orders'>/live/orders/read</a> endpoint.<? } ?> <? if ($localPlatform) { ?>If you download the order summary CSV for a local backtest, the file is stored in <span class='public-file-name'><a href='/docs/v2/local-platform/development-environment/organization-workspaces'>&lt;organizationWorkspace&gt;</a> / &lt;projectName&gt; / backtests / &lt;unixTimestamp&gt; / orders.csv</span>.<? } ?></p>
<p>To view the orders data in CSV format, open the <?=$pageName?> results page, click the <span class='tab-name'>Orders</span> tab, and then click <span class='button-name'>Download Orders</span>. The content of the CSV file is the content displayed in the Orders Summary table when the table rows are collapsed. The timestamps in the CSV file are based in Coordinated Universal Time (UTC). <? if ($pageName == "live") { ?>To download the CSV file with the API, call the <a href='/docs/v2/cloud-platform/api-reference/live-management/read-live-algorithm/export-orders'>/live/export/orders</a> endpoint. The CSV file only contains the orders from the last 750 days. To get older orders, call the <a href='/docs/v2/research-environment/meta-analysis/live-analysis#03-Plot-Order-Fills'><span class='csharp'>ReadLiveOrders</span><span class='python'>read_live_orders</span></a> method or the <a href='/docs/v2/cloud-platform/api-reference/live-management/read-live-algorithm/orders'>/live/orders/read</a> endpoint.<? } ?> <? if ($localPlatform) { ?>If you download the order summary CSV for a local backtest, the file is stored in <span class='public-file-name'><a href='/docs/v2/local-platform/development-environment/organization-workspaces'>&lt;organizationWorkspace&gt;</a> / &lt;projectName&gt; / backtests / &lt;unixTimestamp&gt; / orders.csv</span>.<? } ?></p>

<? if ($pageName == "backtest") { ?>
<h4>Access the Orders JSON</h4>
Expand Down
2 changes: 1 addition & 1 deletion Resources/algorithm-results/trades.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<p>The timestamps in the Trades Summary table are based in Eastern Time (ET).</p>

<h4>Access the Trade Summary CSV</h4>
<p>To view the trades data in CSV format, open the <?=$pageName?> results page, click the <span class='tab-name'>Trades</span> tab, and then click <span class='button-name'>Download Trades</span>. The content of the CSV file is the content displayed in the Trades Summary table when the table rows are collapsed. The timestamps in the CSV file are based in Coordinated Universal Time (UTC). <? if ($localPlatform) { ?>If you download the trade summary CSV for a local backtest, the file is stored in <span class='public-file-name'><a href='/docs/v2/local-platform/development-environment/organization-workspaces'>&lt;organizationWorkspace&gt;</a> / &lt;projectName&gt; / backtests / &lt;unixTimestamp&gt; / trades.csv</span>.<? } ?></p>
<p>To view the trades data in CSV format, open the <?=$pageName?> results page, click the <span class='tab-name'>Trades</span> tab, and then click <span class='button-name'>Download Trades</span>. The content of the CSV file is the content displayed in the Trades Summary table when the table rows are collapsed. The timestamps in the CSV file are based in Coordinated Universal Time (UTC). <? if ($pageName == "live") { ?>To download the CSV file with the API, call the <a href='/docs/v2/cloud-platform/api-reference/live-management/read-live-algorithm/export-trades'>/live/export/trades</a> endpoint.<? } ?> <? if ($localPlatform) { ?>If you download the trade summary CSV for a local backtest, the file is stored in <span class='public-file-name'><a href='/docs/v2/local-platform/development-environment/organization-workspaces'>&lt;organizationWorkspace&gt;</a> / &lt;projectName&gt; / backtests / &lt;unixTimestamp&gt; / trades.csv</span>.<? } ?></p>

<? if ($pageName == "backtest") { ?>
<h4>Access the Trades JSON</h4>
Expand Down
Loading
Loading