Run Options Backtest
curl --request POST \
--url https://api.example.com/api/graph/v1/backtest/v2/options/run \
--header 'Content-Type: application/json' \
--data '
{
"date_from": "2023-12-25",
"date_to": "2023-12-25",
"symbols": [
"<string>"
],
"signal_types": [
"<string>"
],
"quality_tiers": [
"<string>"
],
"regime_filter": [
"<string>"
],
"materialize_run_id": "<string>",
"target_delta": 0.3,
"delta_tolerance": 0.1,
"dte_min": 7,
"dte_max": 45,
"min_open_interest": 10,
"max_spread_pct": 0.1,
"max_quote_age_seconds": 300,
"premium_stop_pct": 0.5,
"premium_target_pct": 0.5,
"dte_floor": 5,
"commission_per_contract": 0.65,
"contracts": 1,
"base_capital_per_trade": 5000,
"max_contracts": 10
}
'import requests
url = "https://api.example.com/api/graph/v1/backtest/v2/options/run"
payload = {
"date_from": "2023-12-25",
"date_to": "2023-12-25",
"symbols": ["<string>"],
"signal_types": ["<string>"],
"quality_tiers": ["<string>"],
"regime_filter": ["<string>"],
"materialize_run_id": "<string>",
"target_delta": 0.3,
"delta_tolerance": 0.1,
"dte_min": 7,
"dte_max": 45,
"min_open_interest": 10,
"max_spread_pct": 0.1,
"max_quote_age_seconds": 300,
"premium_stop_pct": 0.5,
"premium_target_pct": 0.5,
"dte_floor": 5,
"commission_per_contract": 0.65,
"contracts": 1,
"base_capital_per_trade": 5000,
"max_contracts": 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({
date_from: '2023-12-25',
date_to: '2023-12-25',
symbols: ['<string>'],
signal_types: ['<string>'],
quality_tiers: ['<string>'],
regime_filter: ['<string>'],
materialize_run_id: '<string>',
target_delta: 0.3,
delta_tolerance: 0.1,
dte_min: 7,
dte_max: 45,
min_open_interest: 10,
max_spread_pct: 0.1,
max_quote_age_seconds: 300,
premium_stop_pct: 0.5,
premium_target_pct: 0.5,
dte_floor: 5,
commission_per_contract: 0.65,
contracts: 1,
base_capital_per_trade: 5000,
max_contracts: 10
})
};
fetch('https://api.example.com/api/graph/v1/backtest/v2/options/run', 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/v2/options/run",
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([
'date_from' => '2023-12-25',
'date_to' => '2023-12-25',
'symbols' => [
'<string>'
],
'signal_types' => [
'<string>'
],
'quality_tiers' => [
'<string>'
],
'regime_filter' => [
'<string>'
],
'materialize_run_id' => '<string>',
'target_delta' => 0.3,
'delta_tolerance' => 0.1,
'dte_min' => 7,
'dte_max' => 45,
'min_open_interest' => 10,
'max_spread_pct' => 0.1,
'max_quote_age_seconds' => 300,
'premium_stop_pct' => 0.5,
'premium_target_pct' => 0.5,
'dte_floor' => 5,
'commission_per_contract' => 0.65,
'contracts' => 1,
'base_capital_per_trade' => 5000,
'max_contracts' => 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/v2/options/run"
payload := strings.NewReader("{\n \"date_from\": \"2023-12-25\",\n \"date_to\": \"2023-12-25\",\n \"symbols\": [\n \"<string>\"\n ],\n \"signal_types\": [\n \"<string>\"\n ],\n \"quality_tiers\": [\n \"<string>\"\n ],\n \"regime_filter\": [\n \"<string>\"\n ],\n \"materialize_run_id\": \"<string>\",\n \"target_delta\": 0.3,\n \"delta_tolerance\": 0.1,\n \"dte_min\": 7,\n \"dte_max\": 45,\n \"min_open_interest\": 10,\n \"max_spread_pct\": 0.1,\n \"max_quote_age_seconds\": 300,\n \"premium_stop_pct\": 0.5,\n \"premium_target_pct\": 0.5,\n \"dte_floor\": 5,\n \"commission_per_contract\": 0.65,\n \"contracts\": 1,\n \"base_capital_per_trade\": 5000,\n \"max_contracts\": 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/v2/options/run")
.header("Content-Type", "application/json")
.body("{\n \"date_from\": \"2023-12-25\",\n \"date_to\": \"2023-12-25\",\n \"symbols\": [\n \"<string>\"\n ],\n \"signal_types\": [\n \"<string>\"\n ],\n \"quality_tiers\": [\n \"<string>\"\n ],\n \"regime_filter\": [\n \"<string>\"\n ],\n \"materialize_run_id\": \"<string>\",\n \"target_delta\": 0.3,\n \"delta_tolerance\": 0.1,\n \"dte_min\": 7,\n \"dte_max\": 45,\n \"min_open_interest\": 10,\n \"max_spread_pct\": 0.1,\n \"max_quote_age_seconds\": 300,\n \"premium_stop_pct\": 0.5,\n \"premium_target_pct\": 0.5,\n \"dte_floor\": 5,\n \"commission_per_contract\": 0.65,\n \"contracts\": 1,\n \"base_capital_per_trade\": 5000,\n \"max_contracts\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/backtest/v2/options/run")
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 \"date_from\": \"2023-12-25\",\n \"date_to\": \"2023-12-25\",\n \"symbols\": [\n \"<string>\"\n ],\n \"signal_types\": [\n \"<string>\"\n ],\n \"quality_tiers\": [\n \"<string>\"\n ],\n \"regime_filter\": [\n \"<string>\"\n ],\n \"materialize_run_id\": \"<string>\",\n \"target_delta\": 0.3,\n \"delta_tolerance\": 0.1,\n \"dte_min\": 7,\n \"dte_max\": 45,\n \"min_open_interest\": 10,\n \"max_spread_pct\": 0.1,\n \"max_quote_age_seconds\": 300,\n \"premium_stop_pct\": 0.5,\n \"premium_target_pct\": 0.5,\n \"dte_floor\": 5,\n \"commission_per_contract\": 0.65,\n \"contracts\": 1,\n \"base_capital_per_trade\": 5000,\n \"max_contracts\": 10\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}backtest-v2
Run Options Backtest
Run a single-leg options backtest.
Selects optimal contracts for each signal, simulates entry/exit using historical options snapshots, and returns options-specific trades and metrics.
Uses options_data (60s snapshots) for contract selection and exit simulation, and iv_surface_daily for IV percentile context.
POST
/
api
/
graph
/
v1
/
backtest
/
v2
/
options
/
run
Run Options Backtest
curl --request POST \
--url https://api.example.com/api/graph/v1/backtest/v2/options/run \
--header 'Content-Type: application/json' \
--data '
{
"date_from": "2023-12-25",
"date_to": "2023-12-25",
"symbols": [
"<string>"
],
"signal_types": [
"<string>"
],
"quality_tiers": [
"<string>"
],
"regime_filter": [
"<string>"
],
"materialize_run_id": "<string>",
"target_delta": 0.3,
"delta_tolerance": 0.1,
"dte_min": 7,
"dte_max": 45,
"min_open_interest": 10,
"max_spread_pct": 0.1,
"max_quote_age_seconds": 300,
"premium_stop_pct": 0.5,
"premium_target_pct": 0.5,
"dte_floor": 5,
"commission_per_contract": 0.65,
"contracts": 1,
"base_capital_per_trade": 5000,
"max_contracts": 10
}
'import requests
url = "https://api.example.com/api/graph/v1/backtest/v2/options/run"
payload = {
"date_from": "2023-12-25",
"date_to": "2023-12-25",
"symbols": ["<string>"],
"signal_types": ["<string>"],
"quality_tiers": ["<string>"],
"regime_filter": ["<string>"],
"materialize_run_id": "<string>",
"target_delta": 0.3,
"delta_tolerance": 0.1,
"dte_min": 7,
"dte_max": 45,
"min_open_interest": 10,
"max_spread_pct": 0.1,
"max_quote_age_seconds": 300,
"premium_stop_pct": 0.5,
"premium_target_pct": 0.5,
"dte_floor": 5,
"commission_per_contract": 0.65,
"contracts": 1,
"base_capital_per_trade": 5000,
"max_contracts": 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({
date_from: '2023-12-25',
date_to: '2023-12-25',
symbols: ['<string>'],
signal_types: ['<string>'],
quality_tiers: ['<string>'],
regime_filter: ['<string>'],
materialize_run_id: '<string>',
target_delta: 0.3,
delta_tolerance: 0.1,
dte_min: 7,
dte_max: 45,
min_open_interest: 10,
max_spread_pct: 0.1,
max_quote_age_seconds: 300,
premium_stop_pct: 0.5,
premium_target_pct: 0.5,
dte_floor: 5,
commission_per_contract: 0.65,
contracts: 1,
base_capital_per_trade: 5000,
max_contracts: 10
})
};
fetch('https://api.example.com/api/graph/v1/backtest/v2/options/run', 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/v2/options/run",
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([
'date_from' => '2023-12-25',
'date_to' => '2023-12-25',
'symbols' => [
'<string>'
],
'signal_types' => [
'<string>'
],
'quality_tiers' => [
'<string>'
],
'regime_filter' => [
'<string>'
],
'materialize_run_id' => '<string>',
'target_delta' => 0.3,
'delta_tolerance' => 0.1,
'dte_min' => 7,
'dte_max' => 45,
'min_open_interest' => 10,
'max_spread_pct' => 0.1,
'max_quote_age_seconds' => 300,
'premium_stop_pct' => 0.5,
'premium_target_pct' => 0.5,
'dte_floor' => 5,
'commission_per_contract' => 0.65,
'contracts' => 1,
'base_capital_per_trade' => 5000,
'max_contracts' => 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/v2/options/run"
payload := strings.NewReader("{\n \"date_from\": \"2023-12-25\",\n \"date_to\": \"2023-12-25\",\n \"symbols\": [\n \"<string>\"\n ],\n \"signal_types\": [\n \"<string>\"\n ],\n \"quality_tiers\": [\n \"<string>\"\n ],\n \"regime_filter\": [\n \"<string>\"\n ],\n \"materialize_run_id\": \"<string>\",\n \"target_delta\": 0.3,\n \"delta_tolerance\": 0.1,\n \"dte_min\": 7,\n \"dte_max\": 45,\n \"min_open_interest\": 10,\n \"max_spread_pct\": 0.1,\n \"max_quote_age_seconds\": 300,\n \"premium_stop_pct\": 0.5,\n \"premium_target_pct\": 0.5,\n \"dte_floor\": 5,\n \"commission_per_contract\": 0.65,\n \"contracts\": 1,\n \"base_capital_per_trade\": 5000,\n \"max_contracts\": 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/v2/options/run")
.header("Content-Type", "application/json")
.body("{\n \"date_from\": \"2023-12-25\",\n \"date_to\": \"2023-12-25\",\n \"symbols\": [\n \"<string>\"\n ],\n \"signal_types\": [\n \"<string>\"\n ],\n \"quality_tiers\": [\n \"<string>\"\n ],\n \"regime_filter\": [\n \"<string>\"\n ],\n \"materialize_run_id\": \"<string>\",\n \"target_delta\": 0.3,\n \"delta_tolerance\": 0.1,\n \"dte_min\": 7,\n \"dte_max\": 45,\n \"min_open_interest\": 10,\n \"max_spread_pct\": 0.1,\n \"max_quote_age_seconds\": 300,\n \"premium_stop_pct\": 0.5,\n \"premium_target_pct\": 0.5,\n \"dte_floor\": 5,\n \"commission_per_contract\": 0.65,\n \"contracts\": 1,\n \"base_capital_per_trade\": 5000,\n \"max_contracts\": 10\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/graph/v1/backtest/v2/options/run")
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 \"date_from\": \"2023-12-25\",\n \"date_to\": \"2023-12-25\",\n \"symbols\": [\n \"<string>\"\n ],\n \"signal_types\": [\n \"<string>\"\n ],\n \"quality_tiers\": [\n \"<string>\"\n ],\n \"regime_filter\": [\n \"<string>\"\n ],\n \"materialize_run_id\": \"<string>\",\n \"target_delta\": 0.3,\n \"delta_tolerance\": 0.1,\n \"dte_min\": 7,\n \"dte_max\": 45,\n \"min_open_interest\": 10,\n \"max_spread_pct\": 0.1,\n \"max_quote_age_seconds\": 300,\n \"premium_stop_pct\": 0.5,\n \"premium_target_pct\": 0.5,\n \"dte_floor\": 5,\n \"commission_per_contract\": 0.65,\n \"contracts\": 1,\n \"base_capital_per_trade\": 5000,\n \"max_contracts\": 10\n}"
response = http.request(request)
puts response.read_body{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>",
"input": "<unknown>",
"ctx": {}
}
]
}Body
application/json
Request for running an options backtest.
Required range:
0.05 <= x <= 0.8Required range:
0.05 <= x <= 0.3Required range:
1 <= x <= 90Required range:
7 <= x <= 180Required range:
x >= 0Required range:
0.01 <= x <= 0.5Required range:
1 <= x <= 86400Required range:
0.1 <= x <= 0.95Required range:
0.1 <= x <= 5Required range:
0 <= x <= 30Required range:
0 <= x <= 5Required range:
1 <= x <= 100Required range:
100 <= x <= 1000000Required range:
1 <= x <= 500Response
Successful Response