> ## 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.

# Start Backtest Run

> Start an async backtest run.

Returns immediately with run_id and status "pending". The control plane no
longer executes the backtest in-process: it registers a pending run and
enqueues an interactive job for an out-of-process worker to claim (B5
cutover). Poll GET /run/{run_id} for progress. Cancel with
POST /run/{run_id}/cancel.

Enforces max 3 concurrent runs per user (returns 429 if exceeded).



## OpenAPI

````yaml /api/openapi.json post /api/graph/v1/backtest/v2/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/run:
    post:
      tags:
        - backtest-v2
      summary: Start Backtest Run
      description: >-
        Start an async backtest run.


        Returns immediately with run_id and status "pending". The control plane
        no

        longer executes the backtest in-process: it registers a pending run and

        enqueues an interactive job for an out-of-process worker to claim (B5

        cutover). Poll GET /run/{run_id} for progress. Cancel with

        POST /run/{run_id}/cancel.


        Enforces max 3 concurrent runs per user (returns 429 if exceeded).
      operationId: start_backtest_run_api_graph_v1_backtest_v2_run_post
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/BacktestRunRequest'
        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:
    BacktestRunRequest:
      properties:
        score_set_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Score Set Id
        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
        stop_atr:
          type: number
          title: Stop Atr
          default: 1.5
        target_atr:
          type: number
          title: Target Atr
          default: 2.5
        time_stop:
          type: string
          title: Time Stop
          default: '15:45'
        slippage_model:
          type: string
          title: Slippage Model
          default: realistic
        fee_model:
          type: string
          title: Fee Model
          default: commission_free
        initial_capital:
          type: number
          title: Initial Capital
          default: 100000
        max_positions:
          type: integer
          title: Max Positions
          default: 20
        sizing_method:
          $ref: '#/components/schemas/SizingMethod'
          default: score_weighted
        strategy_rules:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Strategy Rules
        universe_symbols:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Universe Symbols
        benchmark_symbol:
          type: string
          title: Benchmark Symbol
          default: SPY
        bar_timeframe:
          type: string
          title: Bar Timeframe
          default: 1m
        timeframe:
          type: string
          title: Timeframe
          default: intraday
        train_test_split:
          anyOf:
            - type: number
            - type: 'null'
          title: Train Test Split
        walk_forward:
          type: boolean
          title: Walk Forward
          default: false
        monte_carlo_n:
          type: integer
          title: Monte Carlo N
          default: 10000
        random_seed:
          anyOf:
            - type: integer
            - type: 'null'
          title: Random Seed
        regime_strategy:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Regime Strategy
        regime_engine_version:
          type: string
          enum:
            - legacy
            - v2
          title: Regime Engine Version
          default: legacy
        regime_logic_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Regime Logic Version
        evidence_logic_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Evidence Logic Version
        regime_feature_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Regime Feature Version
        regime_variant:
          anyOf:
            - type: string
            - type: 'null'
          title: Regime Variant
        regime_horizon_profile:
          anyOf:
            - type: string
              enum:
                - macro
                - swing
                - intraday
            - type: 'null'
          title: Regime Horizon Profile
        regime_read_mode:
          type: string
          enum:
            - historical
            - forward
            - diagnostic
          title: Regime Read Mode
          default: historical
        policy_version:
          anyOf:
            - type: string
            - type: 'null'
          title: Policy Version
        evidence_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Evidence Id
        evidence_selector:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Evidence Selector
        evidence_selector_resolution:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Evidence Selector Resolution
        regime_artifact_ids:
          items:
            type: string
          type: array
          title: Regime Artifact Ids
        portfolio_definition:
          anyOf:
            - $ref: '#/components/schemas/PortfolioDefinition'
            - type: 'null'
        portfolio_preset:
          anyOf:
            - type: string
            - type: 'null'
          title: Portfolio Preset
        max_single_name_pct:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Max Single Name Pct
        rth_only:
          type: boolean
          title: Rth Only
          default: false
        entry_exclude_dates:
          items:
            type: string
            format: date
          type: array
          title: Entry Exclude Dates
        use_final:
          type: boolean
          title: Use Final
          default: false
        skip_first_n_min:
          type: integer
          minimum: 0
          title: Skip First N Min
          default: 0
        no_new_entries_after_et:
          anyOf:
            - type: string
            - type: 'null'
          title: No New Entries After Et
        min_hold_minutes:
          type: integer
          maximum: 390
          minimum: 0
          title: Min Hold Minutes
          default: 0
        use_per_name_spread:
          type: boolean
          title: Use Per Name Spread
          default: false
      type: object
      required:
        - date_from
        - date_to
      title: BacktestRunRequest
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    SizingMethod:
      type: string
      enum:
        - equal_weight
        - score_weighted
        - risk_parity
        - kelly
      title: SizingMethod
    PortfolioDefinition:
      properties:
        portfolio_id:
          type: string
          title: Portfolio Id
          default: ''
        portfolio_version:
          type: integer
          title: Portfolio Version
          default: 1
        name:
          type: string
          title: Name
        universe:
          items:
            type: string
          type: array
          minItems: 1
          title: Universe
        rebalance_freq:
          type: string
          enum:
            - weekly
            - monthly
          title: Rebalance Freq
          default: monthly
        combination:
          $ref: '#/components/schemas/CombinationConfig'
        sleeves:
          items:
            $ref: '#/components/schemas/PortfolioSleeve'
          type: array
          minItems: 1
          title: Sleeves
        borrow_annual:
          type: number
          maximum: 0.2
          minimum: 0
          title: Borrow Annual
          default: 0.02
        cost_per_side:
          type: number
          maximum: 0.01
          minimum: 0
          title: Cost Per Side
          default: 0.00075
      type: object
      required:
        - name
        - universe
        - sleeves
      title: PortfolioDefinition
    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
    CombinationConfig:
      properties:
        method:
          type: string
          const: vol_target
          title: Method
          default: vol_target
        target_vol_annual:
          type: number
          maximum: 1
          exclusiveMinimum: 0
          title: Target Vol Annual
          default: 0.1
        max_leverage:
          type: number
          maximum: 10
          exclusiveMinimum: 0
          title: Max Leverage
          default: 4
      type: object
      title: CombinationConfig
    PortfolioSleeve:
      properties:
        sleeve_id:
          type: string
          title: Sleeve Id
          default: ''
        sleeve_name:
          type: string
          title: Sleeve Name
        strategy_id:
          type: string
          title: Strategy Id
        strategy_version:
          type: integer
          title: Strategy Version
          default: 1
        vol_target_annual:
          type: number
          maximum: 1
          exclusiveMinimum: 0
          title: Vol Target Annual
          default: 0.1
        weight_cap:
          anyOf:
            - type: number
              maximum: 1
              exclusiveMinimum: 0
            - type: 'null'
          title: Weight Cap
        strategy_kind:
          type: string
          enum:
            - rule_driven
            - cross_sectional
          title: Strategy Kind
          default: rule_driven
        rules:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Rules
        cross_sectional_spec:
          anyOf:
            - additionalProperties: true
              type: object
            - type: 'null'
          title: Cross Sectional Spec
        strategy_family:
          anyOf:
            - type: string
            - type: 'null'
          title: Strategy Family
        universe:
          anyOf:
            - items:
                type: string
              type: array
            - type: 'null'
          title: Universe
      type: object
      required:
        - sleeve_name
        - strategy_id
      title: PortfolioSleeve

````