Backtests
Get the Versioned Backtest Strategy JSON Schema and Safe Defaults
GET
/
backtests
/
strategy-schema
Get the Versioned Backtest Strategy JSON Schema and Safe Defaults
curl --request GET \
--url https://quantura.studio/api/v1/backtests/strategy-schema \
--header 'Authorization: Bearer <token>'import requests
url = "https://quantura.studio/api/v1/backtests/strategy-schema"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://quantura.studio/api/v1/backtests/strategy-schema', 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://quantura.studio/api/v1/backtests/strategy-schema",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://quantura.studio/api/v1/backtests/strategy-schema"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://quantura.studio/api/v1/backtests/strategy-schema")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://quantura.studio/api/v1/backtests/strategy-schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Quantura quantile backtest strategy v2",
"description": "Research-only long strategy; exits are OR-combined. Stops take precedence over trailing stops, then take-profit when several signal on the same completed bar.",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"type",
"entry_logic",
"rules"
],
"properties": {
"schema_version": {
"const": 2
},
"type": {
"const": "quantile_rules"
},
"entry_logic": {
"enum": [
"all",
"any"
]
},
"rules": {
"type": "array",
"minItems": 2,
"maxItems": 10,
"items": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"kind",
"condition",
"quantile"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,39}$"
},
"kind": {
"const": "entry"
},
"condition": {
"enum": [
"crosses_above",
"crosses_below",
"at_or_above",
"at_or_below"
]
},
"quantile": {
"type": "number",
"exclusiveMinimum": 0,
"exclusiveMaximum": 1
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"kind",
"target_mode",
"quantile"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,39}$"
},
"kind": {
"enum": [
"take_profit",
"stop_loss"
]
},
"target_mode": {
"const": "quantile"
},
"quantile": {
"type": "number",
"exclusiveMinimum": 0,
"exclusiveMaximum": 1
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"kind",
"target_mode",
"percent"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,39}$"
},
"kind": {
"enum": [
"take_profit",
"stop_loss"
]
},
"target_mode": {
"const": "percent"
},
"percent": {
"type": "number",
"minimum": 0.1,
"maximum": 100
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"kind",
"percent"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,39}$"
},
"kind": {
"const": "trailing_stop"
},
"percent": {
"type": "number",
"minimum": 0.1,
"maximum": 90
}
}
}
]
}
}
}
},
"default_strategy": {
"schema_version": 2,
"type": "quantile_rules",
"entry_logic": "all",
"rules": [
{
"id": "entry_p10",
"kind": "entry",
"condition": "crosses_above",
"quantile": 0.1
},
{
"id": "take_p50",
"kind": "take_profit",
"target_mode": "quantile",
"quantile": 0.5
},
{
"id": "stop_p01",
"kind": "stop_loss",
"target_mode": "quantile",
"quantile": 0.01
}
]
},
"default_replay": {
"context_rows": 128,
"evaluation_windows": 2
},
"default_execution": {
"starting_capital": 1000,
"position_fraction": 1,
"commission_bps": 10,
"slippage_bps": 5
},
"model_capabilities_url": "/api/v1/ensemble-forecasts/models",
"live_eligible": false
},
"meta": {
"api_version": "v1"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
Quantile-rule JSON Schema, default blocks, and bounded replay settings.
The response is of type object.
⌘I
Get the Versioned Backtest Strategy JSON Schema and Safe Defaults
curl --request GET \
--url https://quantura.studio/api/v1/backtests/strategy-schema \
--header 'Authorization: Bearer <token>'import requests
url = "https://quantura.studio/api/v1/backtests/strategy-schema"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://quantura.studio/api/v1/backtests/strategy-schema', 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://quantura.studio/api/v1/backtests/strategy-schema",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$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://quantura.studio/api/v1/backtests/strategy-schema"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://quantura.studio/api/v1/backtests/strategy-schema")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://quantura.studio/api/v1/backtests/strategy-schema")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": {
"schema": {
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "Quantura quantile backtest strategy v2",
"description": "Research-only long strategy; exits are OR-combined. Stops take precedence over trailing stops, then take-profit when several signal on the same completed bar.",
"type": "object",
"additionalProperties": false,
"required": [
"schema_version",
"type",
"entry_logic",
"rules"
],
"properties": {
"schema_version": {
"const": 2
},
"type": {
"const": "quantile_rules"
},
"entry_logic": {
"enum": [
"all",
"any"
]
},
"rules": {
"type": "array",
"minItems": 2,
"maxItems": 10,
"items": {
"oneOf": [
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"kind",
"condition",
"quantile"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,39}$"
},
"kind": {
"const": "entry"
},
"condition": {
"enum": [
"crosses_above",
"crosses_below",
"at_or_above",
"at_or_below"
]
},
"quantile": {
"type": "number",
"exclusiveMinimum": 0,
"exclusiveMaximum": 1
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"kind",
"target_mode",
"quantile"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,39}$"
},
"kind": {
"enum": [
"take_profit",
"stop_loss"
]
},
"target_mode": {
"const": "quantile"
},
"quantile": {
"type": "number",
"exclusiveMinimum": 0,
"exclusiveMaximum": 1
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"kind",
"target_mode",
"percent"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,39}$"
},
"kind": {
"enum": [
"take_profit",
"stop_loss"
]
},
"target_mode": {
"const": "percent"
},
"percent": {
"type": "number",
"minimum": 0.1,
"maximum": 100
}
}
},
{
"type": "object",
"additionalProperties": false,
"required": [
"id",
"kind",
"percent"
],
"properties": {
"id": {
"type": "string",
"pattern": "^[a-z][a-z0-9_]{0,39}$"
},
"kind": {
"const": "trailing_stop"
},
"percent": {
"type": "number",
"minimum": 0.1,
"maximum": 90
}
}
}
]
}
}
}
},
"default_strategy": {
"schema_version": 2,
"type": "quantile_rules",
"entry_logic": "all",
"rules": [
{
"id": "entry_p10",
"kind": "entry",
"condition": "crosses_above",
"quantile": 0.1
},
{
"id": "take_p50",
"kind": "take_profit",
"target_mode": "quantile",
"quantile": 0.5
},
{
"id": "stop_p01",
"kind": "stop_loss",
"target_mode": "quantile",
"quantile": 0.01
}
]
},
"default_replay": {
"context_rows": 128,
"evaluation_windows": 2
},
"default_execution": {
"starting_capital": 1000,
"position_fraction": 1,
"commission_bps": 10,
"slippage_bps": 5
},
"model_capabilities_url": "/api/v1/ensemble-forecasts/models",
"live_eligible": false
},
"meta": {
"api_version": "v1"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"request_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}