Backtests¶
Compare¶
GET /strategies/compare
Several strategies' latest runs on one axis, over the dates they all cover.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
ids |
query | array of string | yes | Strategy ids to compare, two or more. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful Response | CompareView |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.
Runs¶
GET /strategies/runs
Every strategy's latest saved run, newest first.
One row per strategy: the record store keeps the latest run only,
and /strategies/{strategy_id}/record serves its books. A record
that cannot be read is skipped and counted rather than failing the
listing.
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful Response | BacktestRecordCollection |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.
Asset¶
GET /strategies/{strategy_id}/assets/{identifier}
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id |
path | string | yes | Letters, digits, dash and underscore; up to 64. |
identifier |
path | string | yes |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful Response | AssetView |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.
Attribution¶
GET /strategies/{strategy_id}/attribution
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id |
path | string | yes | Letters, digits, dash and underscore; up to 64. |
start |
query | string or null | no | Inclusive start date, YYYY-MM-DD. |
end |
query | string or null | no | Inclusive end date, YYYY-MM-DD. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful Response | AttributionView |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.
Submit Backtest¶
POST /strategies/{strategy_id}/backtest
Backtest a stored strategy, as a job.
The body is everything the strategy does not hold: the period, capital, costs, currency, dividends, benchmark, modelling assumptions, flows and vehicle. The strategy, its index and its implementation are the stored strategy's.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id |
path | string | yes | Letters, digits, dash and underscore; up to 64. |
Request body: StrategyBacktestRequest or null
Responses
| Status | Meaning | Body |
|---|---|---|
| 202 | Successful Response | BacktestJobStatus |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.
Validate Backtest¶
POST /strategies/{strategy_id}/backtest/validate
What a backtest of the strategy would run, without running it.
The same body POST /strategies/{strategy_id}/backtest takes.
Answers the fully resolved settings or every finding, each at its
field's path.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id |
path | string | yes | Letters, digits, dash and underscore; up to 64. |
Request body: StrategyBacktestRequest or null
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful Response | BacktestValidation |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.
Overview¶
GET /strategies/{strategy_id}/overview
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id |
path | string | yes | Letters, digits, dash and underscore; up to 64. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful Response | OverviewView |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.
Backtest Record¶
GET /strategies/{strategy_id}/record
The latest run's books, nested: the record, not the derived view.
BacktestJobStatus.result carries the run payload (rebased level,
returns, drawdown), which is what a chart wants. This is the other
half: the portfolio book with its day-zero NAV, bounded positions and
weights with true totals, and the comparator books, null when the run
had none.
Raises: DataNotFoundError: If the strategy has never been backtested successfully. A record that cannot be read answers the same, as the listing skips it.
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id |
path | string | yes | Letters, digits, dash and underscore; up to 64. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful Response | BacktestResultSummary |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.
Weights¶
GET /strategies/{strategy_id}/weights
Parameters
| Name | In | Type | Required | Description |
|---|---|---|---|---|
strategy_id |
path | string | yes | Letters, digits, dash and underscore; up to 64. |
asof |
query | string or null | no | Date to report at, YYYY-MM-DD. Defaults to the latest rebalance. |
risk |
query | boolean | no | Decompose the portfolio's volatility across its constituents. Off by default: estimating a covariance over every name is the pane's whole cost. |
benchmark |
query | string or null | no | Index id to measure tracking error against, calculated on its own. Requires risk=true. |
Responses
| Status | Meaning | Body |
|---|---|---|
| 200 | Successful Response | WeightsView |
Also the shared errors: 400, 401, 404, 405, 422, 500, 501, 503.