backtesting
Create A Backtest
Submits a backtest definition (underlying symbol, a startDate/endDate window, and one or more legs) and starts the run. A 201 means the backtest is pending and still running; a 200 means it is already completed. Either way the body includes an id to poll with GET /backtests/{id}.
post/backtests
Request
- Base URLhttps://backtester.vast.tastyworks.com
- Authnone declared
Request body
Example request
{
"symbol": "SPY",
"startDate": "2022-01-01",
"endDate": "2022-12-31",
"legs": [
{
"type": "equity-option",
"direction": "short",
"side": "put",
"quantity": 1,
"strikeSelection": "delta",
"delta": 16,
"percentageOTM": 0.1,
"currentPriceOffset": 5,
"premium": 2.5,
"daysUntilExpiration": 45
}
],
"entryConditions": {
"frequency": "every day",
"maximumActiveTrials": 5,
"maximumActiveTrialsBehavior": "don't enter",
"minimumVIX": 15,
"maximumVIX": 30
},
"exitConditions": {
"takeProfitPercentage": 50,
"stopLossPercentage": 100,
"afterDaysInTrade": 21,
"atDaysToExpiration": 7,
"minimumVIX": 12
}
}Response
Backtest completed and ready to read. The body is a fully populated backtest object.
Example response
{
"id": "b1f8c2a4-9e7d-4a31-8c6f-2d5e1a0b3c7e",
"symbol": "SPY",
"startDate": "2022-01-01",
"endDate": "2022-12-31",
"legs": [
{
"type": "equity-option",
"direction": "short",
"side": "put",
"quantity": 1,
"strikeSelection": "delta",
"delta": 16,
"percentageOTM": 0.1,
"currentPriceOffset": 5,
"premium": 2.5,
"daysUntilExpiration": 45
}
],
"entryConditions": {
"frequency": "every day",
"maximumActiveTrials": 5,
"maximumActiveTrialsBehavior": "don't enter",
"minimumVIX": 15,
"maximumVIX": 30
},
"exitConditions": {
"takeProfitPercentage": 50,
"stopLossPercentage": 100,
"afterDaysInTrade": 21,
"atDaysToExpiration": 7,
"minimumVIX": 12
},
"status": "completed",
"trials": [
{
"openDateTime": "2022-01-03T14:30:00Z",
"closeDateTime": "2022-01-20T20:00:00Z",
"profitLoss": 128.5
}
],
"snapshots": [
{
"dateTime": "2022-01-03T14:30:00Z",
"profitLoss": 128.5,
"underlyingPrice": 477.71
}
],
"notices": []
}Changes
No recorded changes to this operation across all 1 revision of this API.