Current trading session summary
curl --request GET \
--url https://api.example.com/api/graph/v1/trade/sessions/currentimport requests
url = "https://api.example.com/api/graph/v1/trade/sessions/current"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/graph/v1/trade/sessions/current', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/graph/v1/trade/sessions/current",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/trade/sessions/current"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/graph/v1/trade/sessions/current")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/trade/sessions/current")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"started_at": "2023-11-07T05:31:56Z",
"cards_by_column": {},
"day_pnl": "0",
"day_pnl_pct": 0,
"realized_pnl": "0",
"unrealized_pnl": "0",
"equity": "<string>",
"buying_power": "<string>",
"day_risk_dollars": "0",
"daily_risk_cap": "0",
"risk_pct_used": 0,
"paper_live_mode": "paper"
}trade-cards
Current trading session summary
Return the current trading session: session_id, card counts per column, and aggregated day P&L.
GET
/
api
/
graph
/
v1
/
trade
/
sessions
/
current
Current trading session summary
curl --request GET \
--url https://api.example.com/api/graph/v1/trade/sessions/currentimport requests
url = "https://api.example.com/api/graph/v1/trade/sessions/current"
response = requests.get(url)
print(response.text)const options = {method: 'GET'};
fetch('https://api.example.com/api/graph/v1/trade/sessions/current', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://api.example.com/api/graph/v1/trade/sessions/current",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/trade/sessions/current"
req, _ := http.NewRequest("GET", url, nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://api.example.com/api/graph/v1/trade/sessions/current")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/trade/sessions/current")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
response = http.request(request)
puts response.read_body{
"session_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"started_at": "2023-11-07T05:31:56Z",
"cards_by_column": {},
"day_pnl": "0",
"day_pnl_pct": 0,
"realized_pnl": "0",
"unrealized_pnl": "0",
"equity": "<string>",
"buying_power": "<string>",
"day_risk_dollars": "0",
"daily_risk_cap": "0",
"risk_pct_used": 0,
"paper_live_mode": "paper"
}Response
200 - application/json
Successful Response
Current trading session summary with P&L header strip data (spec §8).
Count of cards per column: {queue: N, pending: N, open: N, closed: N}
Show child attributes
Show child attributes
Realized + unrealized
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Day P&L as % of equity
Sum of closed card P&L
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Sum of open card P&L
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Alpaca account equity (null if unavailable)
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Alpaca buying power (null if unavailable)
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Sum of risk across Open+Pending cards
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$Risk Profile daily $ cap
Pattern:
^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$day_risk / daily_risk_cap * 100
Active trading mode