cURL
curl --request POST \
--url 'https://api.forecast.example/api/v1/research/backtest' \
--header 'Authorization: Bearer USER_JWT' \
--header 'Content-Type: application/json' \
--data '{
"entry_executable": {
"name": "sample strategy"
},
"objective": "avg_pnl"
}'
const response = await fetch('https://api.forecast.example/api/v1/research/backtest', {
method: 'POST',
headers: {
Authorization: 'Bearer USER_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
entry_executable: {
name: 'sample strategy'
},
objective: 'avg_pnl'
})
});
const report = await response.json();
import requests
report = requests.post(
"https://api.forecast.example/api/v1/research/backtest",
headers={
"Authorization": "Bearer USER_JWT",
"Content-Type": "application/json",
},
json={
"entry_executable": {
"name": "sample strategy"
},
"objective": "avg_pnl",
},
timeout=60,
).json()
{
"schemaVersion": 2,
"strategy": {
"name": "sample strategy",
"kind": "signal_filter",
"featuresUsed": 12,
"candidatesUsed": 8
},
"metrics": {
"n": 184,
"avg_pnl": 4.28
},
"verdict": {
"grade": "B"
}
}
Product APIs
Run research backtest
POST
/
api
/
v1
/
research
/
backtest
cURL
curl --request POST \
--url 'https://api.forecast.example/api/v1/research/backtest' \
--header 'Authorization: Bearer USER_JWT' \
--header 'Content-Type: application/json' \
--data '{
"entry_executable": {
"name": "sample strategy"
},
"objective": "avg_pnl"
}'
const response = await fetch('https://api.forecast.example/api/v1/research/backtest', {
method: 'POST',
headers: {
Authorization: 'Bearer USER_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
entry_executable: {
name: 'sample strategy'
},
objective: 'avg_pnl'
})
});
const report = await response.json();
import requests
report = requests.post(
"https://api.forecast.example/api/v1/research/backtest",
headers={
"Authorization": "Bearer USER_JWT",
"Content-Type": "application/json",
},
json={
"entry_executable": {
"name": "sample strategy"
},
"objective": "avg_pnl",
},
timeout=60,
).json()
{
"schemaVersion": 2,
"strategy": {
"name": "sample strategy",
"kind": "signal_filter",
"featuresUsed": 12,
"candidatesUsed": 8
},
"metrics": {
"n": 184,
"avg_pnl": 4.28
},
"verdict": {
"grade": "B"
}
}
cURL
curl --request POST \
--url 'https://api.forecast.example/api/v1/research/backtest' \
--header 'Authorization: Bearer USER_JWT' \
--header 'Content-Type: application/json' \
--data '{
"entry_executable": {
"name": "sample strategy"
},
"objective": "avg_pnl"
}'
const response = await fetch('https://api.forecast.example/api/v1/research/backtest', {
method: 'POST',
headers: {
Authorization: 'Bearer USER_JWT',
'Content-Type': 'application/json'
},
body: JSON.stringify({
entry_executable: {
name: 'sample strategy'
},
objective: 'avg_pnl'
})
});
const report = await response.json();
import requests
report = requests.post(
"https://api.forecast.example/api/v1/research/backtest",
headers={
"Authorization": "Bearer USER_JWT",
"Content-Type": "application/json",
},
json={
"entry_executable": {
"name": "sample strategy"
},
"objective": "avg_pnl",
},
timeout=60,
).json()
{
"schemaVersion": 2,
"strategy": {
"name": "sample strategy",
"kind": "signal_filter",
"featuresUsed": 12,
"candidatesUsed": 8
},
"metrics": {
"n": 184,
"avg_pnl": 4.28
},
"verdict": {
"grade": "B"
}
}
Body fields
object
required
Strategy definition to evaluate. The current implementation requires this field.
string
Optimization objective, such as
avg_pnl.number
Optional lower time bound in epoch milliseconds.
number
Optional upper time bound in epoch milliseconds.
number
Optional fixed trade size normalization for report output.
Response fields
number
required
Schema version for the analytics report.
object
required
Summary of the tested strategy and feature usage.
object
Core report metrics for the tested strategy.
object
Final report verdict for the run.