Historical analogs as analog_overlay annotations for the chart lab
curl --request POST \
--url https://api.example.com/api/graph/v1/analysis/analogs \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"anchor_time": 123,
"anchor_price": 123,
"limit": 5,
"descriptor": {
"bars": 250,
"interval_seconds": 302400,
"return_pct": 0,
"range_pct": 500,
"close_location": 0.5,
"realized_bar_vol_pct": 500
},
"match_window_bars": 20,
"forward_bars": 20
}
'import requests
url = "https://api.example.com/api/graph/v1/analysis/analogs"
payload = {
"symbol": "<string>",
"anchor_time": 123,
"anchor_price": 123,
"limit": 5,
"descriptor": {
"bars": 250,
"interval_seconds": 302400,
"return_pct": 0,
"range_pct": 500,
"close_location": 0.5,
"realized_bar_vol_pct": 500
},
"match_window_bars": 20,
"forward_bars": 20
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
symbol: '<string>',
anchor_time: 123,
anchor_price: 123,
limit: 5,
descriptor: {
bars: 250,
interval_seconds: 302400,
return_pct: 0,
range_pct: 500,
close_location: 0.5,
realized_bar_vol_pct: 500
},
match_window_bars: 20,
forward_bars: 20
})
};
fetch('https://api.example.com/api/graph/v1/analysis/analogs', 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/analysis/analogs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'symbol' => '<string>',
'anchor_time' => 123,
'anchor_price' => 123,
'limit' => 5,
'descriptor' => [
'bars' => 250,
'interval_seconds' => 302400,
'return_pct' => 0,
'range_pct' => 500,
'close_location' => 0.5,
'realized_bar_vol_pct' => 500
],
'match_window_bars' => 20,
'forward_bars' => 20
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/analysis/analogs"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"anchor_time\": 123,\n \"anchor_price\": 123,\n \"limit\": 5,\n \"descriptor\": {\n \"bars\": 250,\n \"interval_seconds\": 302400,\n \"return_pct\": 0,\n \"range_pct\": 500,\n \"close_location\": 0.5,\n \"realized_bar_vol_pct\": 500\n },\n \"match_window_bars\": 20,\n \"forward_bars\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/graph/v1/analysis/analogs")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"anchor_time\": 123,\n \"anchor_price\": 123,\n \"limit\": 5,\n \"descriptor\": {\n \"bars\": 250,\n \"interval_seconds\": 302400,\n \"return_pct\": 0,\n \"range_pct\": 500,\n \"close_location\": 0.5,\n \"realized_bar_vol_pct\": 500\n },\n \"match_window_bars\": 20,\n \"forward_bars\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/analysis/analogs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"symbol\": \"<string>\",\n \"anchor_time\": 123,\n \"anchor_price\": 123,\n \"limit\": 5,\n \"descriptor\": {\n \"bars\": 250,\n \"interval_seconds\": 302400,\n \"return_pct\": 0,\n \"range_pct\": 500,\n \"close_location\": 0.5,\n \"realized_bar_vol_pct\": 500\n },\n \"match_window_bars\": 20,\n \"forward_bars\": 20\n}"
response = http.request(request)
puts response.read_body{
"schema_version": "an03-v1",
"producer": {
"id": "analogs:qdrant+market-data",
"kind": "model",
"version": "an03-v1"
},
"current_symbol": "<string>",
"interval": "1m",
"session": "regular",
"computed_at": "2023-11-07T05:31:56Z",
"match_window_bars": 51,
"forward_bars": 25,
"top_k": 3,
"data_mode": "historical",
"availability": "available",
"truncated": true,
"explanation": "<string>",
"annotations": [
{
"kind": "trendline",
"anchors": [
{
"time": 123,
"price": 0
}
],
"provenance": {
"agent": "<string>",
"created_at": "<string>",
"analysis_ref": "<string>",
"confidence": 0.5
},
"label": "<string>",
"body": "<string>",
"confidence": 0.5
}
],
"paths": [
{
"id": "<string>",
"revision": 2,
"rank": 3,
"source_match_id": "<string>",
"source_symbol": "<string>",
"source_interval": "1m",
"source_session": "regular",
"source_window": {
"from_time": "2023-11-07T05:31:56Z",
"to_time": "2023-11-07T05:31:56Z"
},
"source_anchor_time": "2023-11-07T05:31:56Z",
"match_score": 0.5,
"finality": "final",
"availability": "available",
"unavailable_reason": "summary_only_match",
"data_rights": {
"status": "allowed",
"entitlement": "ai_chart",
"use": "chart_display_only",
"redistribution": false,
"reason": "<string>"
},
"normalization": {
"method": "backward_split_adjusted_close_return",
"version": "an03-v1",
"base_source_close": 123,
"current_anchor_price": 123
},
"outcome": {
"classification": "win",
"return_pct": 123,
"hold_days": 1,
"source": "<string>",
"finality": "final"
},
"truncated": true,
"points": [
{
"id": "<string>",
"time": "2023-11-07T05:31:56Z",
"session_date": "2023-12-25",
"source_revision": 2,
"finality": "final",
"raw_open": 123,
"raw_high": 123,
"raw_low": 123,
"raw_close": 123,
"volume": 1,
"adjustment_factor": 123,
"adjusted_open": 123,
"adjusted_high": 123,
"adjusted_low": 123,
"adjusted_close": 123,
"normalized_close_return": 123,
"ordinal": 123,
"segment": 1
}
],
"gaps": [
{
"from_time": "2023-11-07T05:31:56Z",
"to_time": "2023-11-07T05:31:56Z",
"reason": "session_break"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Analysis
Historical analogs as analog_overlay annotations for the chart lab
POST
/
api
/
graph
/
v1
/
analysis
/
analogs
Historical analogs as analog_overlay annotations for the chart lab
curl --request POST \
--url https://api.example.com/api/graph/v1/analysis/analogs \
--header 'Content-Type: application/json' \
--data '
{
"symbol": "<string>",
"anchor_time": 123,
"anchor_price": 123,
"limit": 5,
"descriptor": {
"bars": 250,
"interval_seconds": 302400,
"return_pct": 0,
"range_pct": 500,
"close_location": 0.5,
"realized_bar_vol_pct": 500
},
"match_window_bars": 20,
"forward_bars": 20
}
'import requests
url = "https://api.example.com/api/graph/v1/analysis/analogs"
payload = {
"symbol": "<string>",
"anchor_time": 123,
"anchor_price": 123,
"limit": 5,
"descriptor": {
"bars": 250,
"interval_seconds": 302400,
"return_pct": 0,
"range_pct": 500,
"close_location": 0.5,
"realized_bar_vol_pct": 500
},
"match_window_bars": 20,
"forward_bars": 20
}
headers = {"Content-Type": "application/json"}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
symbol: '<string>',
anchor_time: 123,
anchor_price: 123,
limit: 5,
descriptor: {
bars: 250,
interval_seconds: 302400,
return_pct: 0,
range_pct: 500,
close_location: 0.5,
realized_bar_vol_pct: 500
},
match_window_bars: 20,
forward_bars: 20
})
};
fetch('https://api.example.com/api/graph/v1/analysis/analogs', 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/analysis/analogs",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'symbol' => '<string>',
'anchor_time' => 123,
'anchor_price' => 123,
'limit' => 5,
'descriptor' => [
'bars' => 250,
'interval_seconds' => 302400,
'return_pct' => 0,
'range_pct' => 500,
'close_location' => 0.5,
'realized_bar_vol_pct' => 500
],
'match_window_bars' => 20,
'forward_bars' => 20
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://api.example.com/api/graph/v1/analysis/analogs"
payload := strings.NewReader("{\n \"symbol\": \"<string>\",\n \"anchor_time\": 123,\n \"anchor_price\": 123,\n \"limit\": 5,\n \"descriptor\": {\n \"bars\": 250,\n \"interval_seconds\": 302400,\n \"return_pct\": 0,\n \"range_pct\": 500,\n \"close_location\": 0.5,\n \"realized_bar_vol_pct\": 500\n },\n \"match_window_bars\": 20,\n \"forward_bars\": 20\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://api.example.com/api/graph/v1/analysis/analogs")
.header("Content-Type", "application/json")
.body("{\n \"symbol\": \"<string>\",\n \"anchor_time\": 123,\n \"anchor_price\": 123,\n \"limit\": 5,\n \"descriptor\": {\n \"bars\": 250,\n \"interval_seconds\": 302400,\n \"return_pct\": 0,\n \"range_pct\": 500,\n \"close_location\": 0.5,\n \"realized_bar_vol_pct\": 500\n },\n \"match_window_bars\": 20,\n \"forward_bars\": 20\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/analysis/analogs")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"symbol\": \"<string>\",\n \"anchor_time\": 123,\n \"anchor_price\": 123,\n \"limit\": 5,\n \"descriptor\": {\n \"bars\": 250,\n \"interval_seconds\": 302400,\n \"return_pct\": 0,\n \"range_pct\": 500,\n \"close_location\": 0.5,\n \"realized_bar_vol_pct\": 500\n },\n \"match_window_bars\": 20,\n \"forward_bars\": 20\n}"
response = http.request(request)
puts response.read_body{
"schema_version": "an03-v1",
"producer": {
"id": "analogs:qdrant+market-data",
"kind": "model",
"version": "an03-v1"
},
"current_symbol": "<string>",
"interval": "1m",
"session": "regular",
"computed_at": "2023-11-07T05:31:56Z",
"match_window_bars": 51,
"forward_bars": 25,
"top_k": 3,
"data_mode": "historical",
"availability": "available",
"truncated": true,
"explanation": "<string>",
"annotations": [
{
"kind": "trendline",
"anchors": [
{
"time": 123,
"price": 0
}
],
"provenance": {
"agent": "<string>",
"created_at": "<string>",
"analysis_ref": "<string>",
"confidence": 0.5
},
"label": "<string>",
"body": "<string>",
"confidence": 0.5
}
],
"paths": [
{
"id": "<string>",
"revision": 2,
"rank": 3,
"source_match_id": "<string>",
"source_symbol": "<string>",
"source_interval": "1m",
"source_session": "regular",
"source_window": {
"from_time": "2023-11-07T05:31:56Z",
"to_time": "2023-11-07T05:31:56Z"
},
"source_anchor_time": "2023-11-07T05:31:56Z",
"match_score": 0.5,
"finality": "final",
"availability": "available",
"unavailable_reason": "summary_only_match",
"data_rights": {
"status": "allowed",
"entitlement": "ai_chart",
"use": "chart_display_only",
"redistribution": false,
"reason": "<string>"
},
"normalization": {
"method": "backward_split_adjusted_close_return",
"version": "an03-v1",
"base_source_close": 123,
"current_anchor_price": 123
},
"outcome": {
"classification": "win",
"return_pct": 123,
"hold_days": 1,
"source": "<string>",
"finality": "final"
},
"truncated": true,
"points": [
{
"id": "<string>",
"time": "2023-11-07T05:31:56Z",
"session_date": "2023-12-25",
"source_revision": 2,
"finality": "final",
"raw_open": 123,
"raw_high": 123,
"raw_low": 123,
"raw_close": 123,
"volume": 1,
"adjustment_factor": 123,
"adjusted_open": 123,
"adjusted_high": 123,
"adjusted_low": 123,
"adjusted_close": 123,
"normalized_close_return": 123,
"ordinal": 123,
"segment": 1
}
],
"gaps": [
{
"from_time": "2023-11-07T05:31:56Z",
"to_time": "2023-11-07T05:31:56Z",
"reason": "session_break"
}
]
}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Request for historical analogs anchored at a single chart point.
anchor_time / anchor_price are the ONLY client-influenced annotation
fields (provenance is server-owned); both are validated here. symbol is
the paid-embedding input, so it is capped hard.
Ticker symbol (uppercased; [A-Z0-9.-]{1,10})
Overlay anchor time (unix seconds)
Required range:
x <= 4102444800Overlay anchor price (finite, > 0)
Required range:
x <= 1000000000000Max analogs to return
Required range:
1 <= x <= 20Optional outcome filter for historical_setups
Available options:
win, loss, scratch Bounded summary of the visible or selected price-action window
Show child attributes
Show child attributes
Observed source bars ending at the exact match anchor
Required range:
3 <= x <= 100Bounded observed source bars after the exact match anchor
Required range:
1 <= x <= 50Response
Successful Response
Allowed value:
"an03-v1"Show child attributes
Show child attributes
Minimum string length:
1Pattern:
^[A-Z][A-Z0-9.-]*$Allowed value:
"1m"Allowed value:
"regular"Required range:
3 <= x <= 100Required range:
1 <= x <= 50Required range:
1 <= x <= 5Allowed value:
"historical"Available options:
available, partial, unavailable Show child attributes
Show child attributes
Maximum array length:
5Show child attributes
Show child attributes