Skip to main content
POST
Run a backtest
Start from a recipe rather than a blank spec, and see Strategy specification for what every field does.

Authorizations

X-API-Key
string
header
required

Your Sandmark Backtesting API key.

Query Parameters

format
enum<string>
default:json

json for the full result, html for a self-contained report, csv for a zip of trades, positions and equity, xlsx for an Excel workbook.

Available options:
json,
html,
csv,
xlsx
theme
enum<string>
default:light

Colour theme of the html report. Ignored for other formats.

Available options:
light,
dark

Body

application/json
start
string<date>
required

First day of the backtest, YYYY-MM-DD. Must fall inside your backtest lookback; data begins 2021-09-01.

end
string<date>
required

Last day of the backtest, YYYY-MM-DD, inclusive.

structure
StructureSpecModel · object
required

The legs to trade, how their expiry is chosen, and an optional hedge.

schema_version
integer

Defaults to 1.

Required range: 1 <= x <= 1
name
string
default:backtest
Required string length: 1 - 120
asset
enum<string>
default:DER.BTC_USD

Underlying to trade. Inverse BTC and ETH carry history from September 2021.

Available options:
DER.BTC_USD,
DER.ETH_USD,
DER.SOL_USDC,
DER.XRP_USDC
clock
ClockSpec · object

When the strategy looks at the market.

capital
CapitalSpec · object

Starting equity, in coin, and how each new position is sized.

lifecycle
LifecycleSpec · object

When positions are opened and closed. With no rules, positions are held to expiry.

costs
CostsSpec · object

Fill model and fees.

Response

The backtest result, in the requested format.

name
string
required
asset
string
required
bars
integer
required
runtime_seconds
number
required
stats
StatsModel · object
required
equity
EquityPointModel · object[]
required
positions
PositionModel · object[]
required
trades
TradeModel · object[]
required
strategy
StrategyDescriptionModel · object | null

What the strategy does, derived from its configuration rather than its name, so it cannot describe something other than what ran.

warnings
string[]

Not decoration. Silent data holes are the main way an options backtest lies, so degraded fills, carried marks and bars the chain could not serve are counted here.

diagnostics
Diagnostics · object