tastytradeDeveloper Docs
Legacy ↗

API Reference / Backtesting

Simulate A Single Trade

simulateTrade
post/simulate-trade

Base URL: https://backtester.vast.tastyworks.com (Backtester API)

Returns historical pricing for one trade without defining a full backtest. Supply an `underlying` and one or more `legs` (each leg uses tastytrade/OCC symbology), optionally bounded by `startTime`/`endTime`. The response is a time series of price points with the trade `effect` (debit or credit), `underlyingPrice`, and `delta`.

Code samples

curl -X POST 'https://backtester.vast.tastyworks.com/simulate-trade' \
  -H 'Authorization: Bearer YOUR_ACCESS_TOKEN' \
  -H 'User-Agent: tastytrade-docs-example/1.0' \
  -H 'Content-Type: application/json' \
  -d '{
  "underlying": "string",
  "startTime": "2024-01-15T14:30:00.000Z",
  "endTime": "2024-01-15T14:30:00.000Z",
  "legs": [
    {
      "symbol": "AAPL",
      "direction": "long",
      "quantity": 100
    }
  ]
}'

Parameters

No parameters.

Request bodyapplication/json

Example

{
  "underlying": "string",
  "startTime": "2024-01-15T14:30:00.000Z",
  "endTime": "2024-01-15T14:30:00.000Z",
  "legs": [
    {
      "symbol": "AAPL",
      "direction": "long",
      "quantity": 100
    }
  ]
}

Schema

  • underlyingstring

    Underlying symbol of the trade

  • startTimestring <date-time>

    Optionally, start time of the trade in ISO 8601 format.

  • endTimestring <date-time>

    Optionally, end time of the trade in ISO 8601 format.

  • legsarray<object>
    • symbolstring

      The leg symbol uses the tastytrade / OCC symbology convention - https://developer.tastytrade.com/api-overview/#tastytrade-symbology

    • directionstring

      enum: long, short

    • quantityinteger

Responses

200A time-ordered series of price points for the simulated trade.application/json

Example response

[
  {
    "dateTime": "2024-01-15T14:30:00.000Z",
    "price": "100.00",
    "effect": "debit",
    "underlyingPrice": "100.00",
    "delta": "string"
  }
]

Schema

Array — each item is an object with fields:

  • dateTimestring <date-time>
  • pricestring
  • effectstring

    enum: debit, credit

  • underlyingPricestring
  • deltastring
400The request body was malformed, for example an invalid leg `symbol` or `direction`.
401Unauthorized.
404No history is available for the requested underlying or time range.
429Request rate exceeded reasonable thresholds. Back off exponentially before retrying.

Related

Agents: this page is also Markdown (with the embedded OpenAPI definition) — append .md or send Accept: text/markdown. Index at /llms.txt.