Start parameter optimization
curl --request POST \
--url https://api.example.com/api/graph/v1/backtest/optimize \
--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_range": [
0.5,
0.75,
1,
1.25,
1.5
],
"target_atr_range": [
1,
1.5,
2,
2.5,
3
],
"top_n": 10
}
'import requests
url = "https://api.example.com/api/graph/v1/backtest/optimize"
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_range": [0.5, 0.75, 1, 1.25, 1.5],
"target_atr_range": [1, 1.5, 2, 2.5, 3],
"top_n": 10
}
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_range: [0.5, 0.75, 1, 1.25, 1.5],
target_atr_range: [1, 1.5, 2, 2.5, 3],
top_n: 10
})
};
fetch('https://api.example.com/api/graph/v1/backtest/optimize', 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/optimize",
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_range' => [
0.5,
0.75,
1,
1.25,
1.5
],
'target_atr_range' => [
1,
1.5,
2,
2.5,
3
],
'top_n' => 10
]),
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/optimize"
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_range\": [\n 0.5,\n 0.75,\n 1,\n 1.25,\n 1.5\n ],\n \"target_atr_range\": [\n 1,\n 1.5,\n 2,\n 2.5,\n 3\n ],\n \"top_n\": 10\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/optimize")
.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_range\": [\n 0.5,\n 0.75,\n 1,\n 1.25,\n 1.5\n ],\n \"target_atr_range\": [\n 1,\n 1.5,\n 2,\n 2.5,\n 3\n ],\n \"top_n\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/backtest/optimize")
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_range\": [\n 0.5,\n 0.75,\n 1,\n 1.25,\n 1.5\n ],\n \"target_atr_range\": [\n 1,\n 1.5,\n 2,\n 2.5,\n 3\n ],\n \"top_n\": 10\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"results": [
{
"parameter_set": {},
"total_trades": 123,
"win_rate": 123,
"avg_rr_ratio": 123,
"sharpe_ratio": 123,
"profit_factor": 123,
"max_drawdown": 123
}
],
"progress_pct": 0,
"error_message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Backtest
Start parameter optimization
Run a grid search over stop/target ATR multiplier combinations.
POST
/
api
/
graph
/
v1
/
backtest
/
optimize
Start parameter optimization
curl --request POST \
--url https://api.example.com/api/graph/v1/backtest/optimize \
--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_range": [
0.5,
0.75,
1,
1.25,
1.5
],
"target_atr_range": [
1,
1.5,
2,
2.5,
3
],
"top_n": 10
}
'import requests
url = "https://api.example.com/api/graph/v1/backtest/optimize"
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_range": [0.5, 0.75, 1, 1.25, 1.5],
"target_atr_range": [1, 1.5, 2, 2.5, 3],
"top_n": 10
}
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_range: [0.5, 0.75, 1, 1.25, 1.5],
target_atr_range: [1, 1.5, 2, 2.5, 3],
top_n: 10
})
};
fetch('https://api.example.com/api/graph/v1/backtest/optimize', 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/optimize",
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_range' => [
0.5,
0.75,
1,
1.25,
1.5
],
'target_atr_range' => [
1,
1.5,
2,
2.5,
3
],
'top_n' => 10
]),
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/optimize"
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_range\": [\n 0.5,\n 0.75,\n 1,\n 1.25,\n 1.5\n ],\n \"target_atr_range\": [\n 1,\n 1.5,\n 2,\n 2.5,\n 3\n ],\n \"top_n\": 10\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/optimize")
.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_range\": [\n 0.5,\n 0.75,\n 1,\n 1.25,\n 1.5\n ],\n \"target_atr_range\": [\n 1,\n 1.5,\n 2,\n 2.5,\n 3\n ],\n \"top_n\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/backtest/optimize")
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_range\": [\n 0.5,\n 0.75,\n 1,\n 1.25,\n 1.5\n ],\n \"target_atr_range\": [\n 1,\n 1.5,\n 2,\n 2.5,\n 3\n ],\n \"top_n\": 10\n}"
response = http.request(request)
puts response.read_body{
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"status": "pending",
"results": [
{
"parameter_set": {},
"total_trades": 123,
"win_rate": 123,
"avg_rr_ratio": 123,
"sharpe_ratio": 123,
"profit_factor": 123,
"max_drawdown": 123
}
],
"progress_pct": 0,
"error_message": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Request to launch a parameter optimization 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:
1 <= x <= 50Response
Optimization launched
Optimization run status and results.