> ## Documentation Index
> Fetch the complete documentation index at: https://docs.sequency.sh/llms.txt
> Use this file to discover all available pages before exploring further.

# Run Options Backtest

> Run a single-leg options backtest.

Selects optimal contracts for each signal, simulates entry/exit using
historical options snapshots, and returns options-specific trades and metrics.

Uses options_data (60s snapshots) for contract selection and exit simulation,
and iv_surface_daily for IV percentile context.



## OpenAPI

````yaml /api/openapi.json post /api/graph/v1/backtest/v2/options/run
openapi: 3.1.0
info:
  title: Sequency Graph API
  description: >

    # Sequency Graph-Native Trading API


    Graph-native API for trading intelligence, built on FalkorDB.


    ## Features


    - **Screener**: Filter stocks using graph-native queries with relationship
    expansion

    - **Stock Detail**: Complete stock context with all relationships

    - **Confluence Scoring**: Setup quality assessment with weighted components

    - **Strategy Matching**: Find matching options strategies via graph
    traversal

    - **Market Context**: Current market-wide context for trading decisions


    ## Data Sources


    All data is sourced from the FalkorDB knowledge graph, populated by:

    - Pattern detector (Go) - Technical indicators, patterns

    - Graph sync service - Levels, volume profiles, news, day classification
  version: 1.0.0
servers: []
security: []
paths:
  /api/graph/v1/backtest/v2/options/run:
    post:
      tags:
        - backtest-v2
      summary: Run Options Backtest
      description: >-
        Run a single-leg options backtest.


        Selects optimal contracts for each signal, simulates entry/exit using

        historical options snapshots, and returns options-specific trades and
        metrics.


        Uses options_data (60s snapshots) for contract selection and exit
        simulation,

        and iv_surface_daily for IV percentile context.
      operationId: run_options_backtest_api_graph_v1_backtest_v2_options_run_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/OptionsBacktestRequest'
        required: true
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema: {}
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    OptionsBacktestRequest:
      properties:
        symbols:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Symbols
        signal_types:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Signal Types
        quality_tiers:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Quality Tiers
        regime_filter:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Regime Filter
        date_from:
          type: string
          format: date
          title: Date From
        date_to:
          type: string
          format: date
          title: Date To
        materialize_run_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Materialize Run Id
        target_delta:
          type: number
          maximum: 0.8
          minimum: 0.05
          title: Target Delta
          default: 0.3
        delta_tolerance:
          type: number
          maximum: 0.3
          minimum: 0.05
          title: Delta Tolerance
          default: 0.1
        dte_min:
          type: integer
          maximum: 90
          minimum: 1
          title: Dte Min
          default: 7
        dte_max:
          type: integer
          maximum: 180
          minimum: 7
          title: Dte Max
          default: 45
        min_open_interest:
          type: integer
          minimum: 0
          title: Min Open Interest
          default: 10
        max_spread_pct:
          type: number
          maximum: 0.5
          minimum: 0.01
          title: Max Spread Pct
          default: 0.1
        max_quote_age_seconds:
          type: number
          maximum: 86400
          minimum: 1
          title: Max Quote Age Seconds
          default: 300
        premium_stop_pct:
          type: number
          maximum: 0.95
          minimum: 0.1
          title: Premium Stop Pct
          default: 0.5
        premium_target_pct:
          type: number
          maximum: 5
          minimum: 0.1
          title: Premium Target Pct
          default: 0.5
        dte_floor:
          type: integer
          maximum: 30
          minimum: 0
          title: Dte Floor
          default: 5
        commission_per_contract:
          type: number
          maximum: 5
          minimum: 0
          title: Commission Per Contract
          default: 0.65
        contracts:
          type: integer
          maximum: 100
          minimum: 1
          title: Contracts
          default: 1
        base_capital_per_trade:
          type: number
          maximum: 1000000
          minimum: 100
          title: Base Capital Per Trade
          default: 5000
        max_contracts:
          type: integer
          maximum: 500
          minimum: 1
          title: Max Contracts
          default: 10
      type: object
      required:
        - date_from
        - date_to
      title: OptionsBacktestRequest
      description: Request for running an options backtest.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````