Start a backtest run
curl --request POST \
--url https://api.example.com/api/graph/v1/backtest \
--header 'Content-Type: application/json' \
--data '
{
"symbols": [
"<string>"
],
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"signal_types": [
"vwap_touch",
"ib_breakout",
"ib_retest",
"or_hold",
"level_confluence",
"trend_continuation"
],
"stop_atr_mult": 1,
"t1_atr_mult": 1,
"t2_atr_mult": 1,
"t3_atr_mult": 1,
"time_stop_et": "15:45",
"position_size": 100,
"slippage_per_share": 0,
"commission_per_share": 0,
"gate_thresholds": {}
}
'import requests
url = "https://api.example.com/api/graph/v1/backtest"
payload = {
"symbols": ["<string>"],
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"signal_types": ["vwap_touch", "ib_breakout", "ib_retest", "or_hold", "level_confluence", "trend_continuation"],
"stop_atr_mult": 1,
"t1_atr_mult": 1,
"t2_atr_mult": 1,
"t3_atr_mult": 1,
"time_stop_et": "15:45",
"position_size": 100,
"slippage_per_share": 0,
"commission_per_share": 0,
"gate_thresholds": {}
}
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({
symbols: ['<string>'],
start_date: '2023-12-25',
end_date: '2023-12-25',
signal_types: [
'vwap_touch',
'ib_breakout',
'ib_retest',
'or_hold',
'level_confluence',
'trend_continuation'
],
stop_atr_mult: 1,
t1_atr_mult: 1,
t2_atr_mult: 1,
t3_atr_mult: 1,
time_stop_et: '15:45',
position_size: 100,
slippage_per_share: 0,
commission_per_share: 0,
gate_thresholds: {}
})
};
fetch('https://api.example.com/api/graph/v1/backtest', 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/backtest",
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([
'symbols' => [
'<string>'
],
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'signal_types' => [
'vwap_touch',
'ib_breakout',
'ib_retest',
'or_hold',
'level_confluence',
'trend_continuation'
],
'stop_atr_mult' => 1,
't1_atr_mult' => 1,
't2_atr_mult' => 1,
't3_atr_mult' => 1,
'time_stop_et' => '15:45',
'position_size' => 100,
'slippage_per_share' => 0,
'commission_per_share' => 0,
'gate_thresholds' => [
]
]),
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/backtest"
payload := strings.NewReader("{\n \"symbols\": [\n \"<string>\"\n ],\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"signal_types\": [\n \"vwap_touch\",\n \"ib_breakout\",\n \"ib_retest\",\n \"or_hold\",\n \"level_confluence\",\n \"trend_continuation\"\n ],\n \"stop_atr_mult\": 1,\n \"t1_atr_mult\": 1,\n \"t2_atr_mult\": 1,\n \"t3_atr_mult\": 1,\n \"time_stop_et\": \"15:45\",\n \"position_size\": 100,\n \"slippage_per_share\": 0,\n \"commission_per_share\": 0,\n \"gate_thresholds\": {}\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/backtest")
.header("Content-Type", "application/json")
.body("{\n \"symbols\": [\n \"<string>\"\n ],\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"signal_types\": [\n \"vwap_touch\",\n \"ib_breakout\",\n \"ib_retest\",\n \"or_hold\",\n \"level_confluence\",\n \"trend_continuation\"\n ],\n \"stop_atr_mult\": 1,\n \"t1_atr_mult\": 1,\n \"t2_atr_mult\": 1,\n \"t3_atr_mult\": 1,\n \"time_stop_et\": \"15:45\",\n \"position_size\": 100,\n \"slippage_per_share\": 0,\n \"commission_per_share\": 0,\n \"gate_thresholds\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/backtest")
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 \"symbols\": [\n \"<string>\"\n ],\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"signal_types\": [\n \"vwap_touch\",\n \"ib_breakout\",\n \"ib_retest\",\n \"or_hold\",\n \"level_confluence\",\n \"trend_continuation\"\n ],\n \"stop_atr_mult\": 1,\n \"t1_atr_mult\": 1,\n \"t2_atr_mult\": 1,\n \"t3_atr_mult\": 1,\n \"time_stop_et\": \"15:45\",\n \"position_size\": 100,\n \"slippage_per_share\": 0,\n \"commission_per_share\": 0,\n \"gate_thresholds\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"symbols": [
"<string>"
],
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"signal_types": [
"<string>"
],
"stop_atr_mult": 123,
"t1_atr_mult": 123,
"t2_atr_mult": 123,
"t3_atr_mult": 123,
"time_stop_et": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"total_trades": 123,
"win_count": 123,
"loss_count": 123,
"win_rate": 123,
"avg_rr_ratio": 123,
"total_pnl": 123,
"max_drawdown": 123,
"profit_factor": 123,
"sharpe_ratio": 123,
"by_signal_type": [
{
"signal_type": "<string>",
"total_trades": 123,
"win_count": 123,
"loss_count": 123,
"win_rate": 123,
"avg_pnl_r": 123,
"total_pnl": 123,
"expectancy_per_r": 0
}
],
"by_symbol": [
{
"symbol": "<string>",
"total_trades": 123,
"win_count": 123,
"loss_count": 123,
"win_rate": 123,
"total_pnl": 123,
"max_drawdown": 123
}
],
"equity_curve": [
{
"trade_num": 123,
"cumulative_pnl": 123,
"cumulative_r": 123,
"timestamp": "<string>"
}
],
"validation_gate": {
"passed": true,
"criteria": [
{
"name": "<string>",
"description": "<string>",
"threshold": "<string>",
"actual": "<string>",
"passed": true
}
]
},
"progress_pct": 0,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"error_message": "<string>",
"analysis_result": {
"summary": "<string>",
"signal_insights": [
{
"signal_type": "<string>",
"assessment": "<string>",
"reasoning": "<string>",
"suggestion": "<string>"
}
],
"risk_assessment": "<string>",
"parameter_suggestions": [
"<string>"
],
"edge_quality": "<string>",
"edge_confidence": 50,
"analyzed_at": "<string>",
"tokens_used": 123
},
"position_size": 100,
"slippage_per_share": 0,
"commission_per_share": 0,
"by_exit_reason": [
{}
],
"advanced_metrics": {},
"benchmark_curve": [
{}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Backtest
Start a backtest run
Launch a historical backtest of intraday signal strategies.
POST
/
api
/
graph
/
v1
/
backtest
Start a backtest run
curl --request POST \
--url https://api.example.com/api/graph/v1/backtest \
--header 'Content-Type: application/json' \
--data '
{
"symbols": [
"<string>"
],
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"signal_types": [
"vwap_touch",
"ib_breakout",
"ib_retest",
"or_hold",
"level_confluence",
"trend_continuation"
],
"stop_atr_mult": 1,
"t1_atr_mult": 1,
"t2_atr_mult": 1,
"t3_atr_mult": 1,
"time_stop_et": "15:45",
"position_size": 100,
"slippage_per_share": 0,
"commission_per_share": 0,
"gate_thresholds": {}
}
'import requests
url = "https://api.example.com/api/graph/v1/backtest"
payload = {
"symbols": ["<string>"],
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"signal_types": ["vwap_touch", "ib_breakout", "ib_retest", "or_hold", "level_confluence", "trend_continuation"],
"stop_atr_mult": 1,
"t1_atr_mult": 1,
"t2_atr_mult": 1,
"t3_atr_mult": 1,
"time_stop_et": "15:45",
"position_size": 100,
"slippage_per_share": 0,
"commission_per_share": 0,
"gate_thresholds": {}
}
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({
symbols: ['<string>'],
start_date: '2023-12-25',
end_date: '2023-12-25',
signal_types: [
'vwap_touch',
'ib_breakout',
'ib_retest',
'or_hold',
'level_confluence',
'trend_continuation'
],
stop_atr_mult: 1,
t1_atr_mult: 1,
t2_atr_mult: 1,
t3_atr_mult: 1,
time_stop_et: '15:45',
position_size: 100,
slippage_per_share: 0,
commission_per_share: 0,
gate_thresholds: {}
})
};
fetch('https://api.example.com/api/graph/v1/backtest', 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/backtest",
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([
'symbols' => [
'<string>'
],
'start_date' => '2023-12-25',
'end_date' => '2023-12-25',
'signal_types' => [
'vwap_touch',
'ib_breakout',
'ib_retest',
'or_hold',
'level_confluence',
'trend_continuation'
],
'stop_atr_mult' => 1,
't1_atr_mult' => 1,
't2_atr_mult' => 1,
't3_atr_mult' => 1,
'time_stop_et' => '15:45',
'position_size' => 100,
'slippage_per_share' => 0,
'commission_per_share' => 0,
'gate_thresholds' => [
]
]),
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/backtest"
payload := strings.NewReader("{\n \"symbols\": [\n \"<string>\"\n ],\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"signal_types\": [\n \"vwap_touch\",\n \"ib_breakout\",\n \"ib_retest\",\n \"or_hold\",\n \"level_confluence\",\n \"trend_continuation\"\n ],\n \"stop_atr_mult\": 1,\n \"t1_atr_mult\": 1,\n \"t2_atr_mult\": 1,\n \"t3_atr_mult\": 1,\n \"time_stop_et\": \"15:45\",\n \"position_size\": 100,\n \"slippage_per_share\": 0,\n \"commission_per_share\": 0,\n \"gate_thresholds\": {}\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/backtest")
.header("Content-Type", "application/json")
.body("{\n \"symbols\": [\n \"<string>\"\n ],\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"signal_types\": [\n \"vwap_touch\",\n \"ib_breakout\",\n \"ib_retest\",\n \"or_hold\",\n \"level_confluence\",\n \"trend_continuation\"\n ],\n \"stop_atr_mult\": 1,\n \"t1_atr_mult\": 1,\n \"t2_atr_mult\": 1,\n \"t3_atr_mult\": 1,\n \"time_stop_et\": \"15:45\",\n \"position_size\": 100,\n \"slippage_per_share\": 0,\n \"commission_per_share\": 0,\n \"gate_thresholds\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/backtest")
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 \"symbols\": [\n \"<string>\"\n ],\n \"start_date\": \"2023-12-25\",\n \"end_date\": \"2023-12-25\",\n \"signal_types\": [\n \"vwap_touch\",\n \"ib_breakout\",\n \"ib_retest\",\n \"or_hold\",\n \"level_confluence\",\n \"trend_continuation\"\n ],\n \"stop_atr_mult\": 1,\n \"t1_atr_mult\": 1,\n \"t2_atr_mult\": 1,\n \"t3_atr_mult\": 1,\n \"time_stop_et\": \"15:45\",\n \"position_size\": 100,\n \"slippage_per_share\": 0,\n \"commission_per_share\": 0,\n \"gate_thresholds\": {}\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"symbols": [
"<string>"
],
"start_date": "2023-12-25",
"end_date": "2023-12-25",
"signal_types": [
"<string>"
],
"stop_atr_mult": 123,
"t1_atr_mult": 123,
"t2_atr_mult": 123,
"t3_atr_mult": 123,
"time_stop_et": "<string>",
"created_at": "2023-11-07T05:31:56Z",
"total_trades": 123,
"win_count": 123,
"loss_count": 123,
"win_rate": 123,
"avg_rr_ratio": 123,
"total_pnl": 123,
"max_drawdown": 123,
"profit_factor": 123,
"sharpe_ratio": 123,
"by_signal_type": [
{
"signal_type": "<string>",
"total_trades": 123,
"win_count": 123,
"loss_count": 123,
"win_rate": 123,
"avg_pnl_r": 123,
"total_pnl": 123,
"expectancy_per_r": 0
}
],
"by_symbol": [
{
"symbol": "<string>",
"total_trades": 123,
"win_count": 123,
"loss_count": 123,
"win_rate": 123,
"total_pnl": 123,
"max_drawdown": 123
}
],
"equity_curve": [
{
"trade_num": 123,
"cumulative_pnl": 123,
"cumulative_r": 123,
"timestamp": "<string>"
}
],
"validation_gate": {
"passed": true,
"criteria": [
{
"name": "<string>",
"description": "<string>",
"threshold": "<string>",
"actual": "<string>",
"passed": true
}
]
},
"progress_pct": 0,
"started_at": "2023-11-07T05:31:56Z",
"completed_at": "2023-11-07T05:31:56Z",
"error_message": "<string>",
"analysis_result": {
"summary": "<string>",
"signal_insights": [
{
"signal_type": "<string>",
"assessment": "<string>",
"reasoning": "<string>",
"suggestion": "<string>"
}
],
"risk_assessment": "<string>",
"parameter_suggestions": [
"<string>"
],
"edge_quality": "<string>",
"edge_confidence": 50,
"analyzed_at": "<string>",
"tokens_used": 123
},
"position_size": 100,
"slippage_per_share": 0,
"commission_per_share": 0,
"by_exit_reason": [
{}
],
"advanced_metrics": {},
"benchmark_curve": [
{}
]
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Request to launch a backtest run.
Required array length:
1 - 20 elementsMinimum array length:
1Intraday signal types available for backtesting.
Available options:
vwap_touch, ib_breakout, ib_retest, or_hold, level_confluence, trend_continuation Required range:
x <= 5Required range:
x <= 10Required range:
x <= 10Required range:
x <= 10Pattern:
^\d{2}:\d{2}$Required range:
1 <= x <= 10000Required range:
0 <= x <= 1Required range:
0 <= x <= 0.1Response
Backtest launched
Full backtest run status and results.
Backtest run lifecycle status.
Available options:
pending, running, completed, failed, cancelled Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Show child attributes
Aggregate validation gate result.
Show child attributes
Show child attributes
Structured response from the backtest analysis LLM agent.
Show child attributes
Show child attributes