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

# Finalize a strategy version

> Turns a draft version into a ready version. If `version` is omitted, a new ready version is created directly.



## OpenAPI

````yaml /openapi/traseq-public-agent.json post /public/v1/strategies/{id}/versions/finalize
openapi: 3.0.0
info:
  title: Traseq Agent API
  description: >-
    Public, versioned API for external integrations and AI agents. Includes API
    key management and machine-readable OpenAPI.
  version: 1.0.0
  contact: {}
servers: []
security: []
tags:
  - name: API Keys
    description: Workspace-scoped API key management
  - name: Agent API
    description: Public API for external integrations and AI agents
paths:
  /public/v1/strategies/{id}/versions/finalize:
    post:
      tags:
        - Agent API
      summary: Finalize a strategy version
      description: >-
        Turns a draft version into a ready version. If `version` is omitted, a
        new ready version is created directly.
      operationId: PublicOpenApiController_finalizeStrategyVersion
      parameters:
        - name: id
          required: true
          in: path
          schema:
            type: string
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - settings
              anyOf:
                - required:
                    - strategyAst
                - required:
                    - signalGraph
              properties:
                version:
                  type: integer
                  minimum: 1
                  example: 1
                forkedFromVersionId:
                  type: string
                  format: uuid
                ignoreWarnings:
                  type: boolean
                  example: false
                strategyAst:
                  type: object
                  additionalProperties: true
                  description: >-
                    Canonical strategy protocol payload. Use this when the
                    client already authors StrategyAstV1 directly.
                  example:
                    protocol: traseq.strategy
                    version: 1
                    strategy:
                      kind: strategy
                      defaults:
                        instrument:
                          symbol: BTCUSDT
                        timeframe: 1h
                        warmupBars: 50
                      entry:
                        kind: entry
                        setup:
                          kind: compare
                          op: gt
                          left:
                            kind: market
                            field: close
                          right:
                            kind: const
                            value: 20000
                        trigger:
                          kind: compare
                          op: gt
                          left:
                            kind: market
                            field: close
                          right:
                            kind: const
                            value: 20100
                        filters:
                          - kind: pattern
                            name: hammer
                        action:
                          side: long
                          sizing:
                            mode: fixed
                            value: 1
                signalGraph:
                  type: object
                  additionalProperties: false
                  required:
                    - protocol
                    - version
                    - nodes
                    - strategy
                  properties:
                    protocol:
                      type: string
                      enum:
                        - traseq.signal-graph
                    version:
                      type: integer
                      enum:
                        - 2
                    meta:
                      type: object
                      additionalProperties: false
                      properties:
                        name:
                          type: string
                        tags:
                          type: array
                          items:
                            type: string
                        source:
                          type: object
                          additionalProperties: false
                          properties:
                            editor:
                              type: string
                              enum:
                                - token-flow
                                - text-dsl
                                - ai
                                - runtime-strategy
                                - signal-graph
                            blockIds:
                              type: array
                              items:
                                type: string
                    nodes:
                      type: array
                      minItems: 1
                      items:
                        oneOf:
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - value
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - const
                                  value:
                                    type: number
                                    example: 20100
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - field
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - market
                                  field:
                                    type: string
                                    enum:
                                      - open
                                      - high
                                      - low
                                      - close
                                      - hl2
                                      - hlc3
                                      - ohlc4
                                      - typical
                                      - median
                                      - volume
                                  timeframe:
                                    type: string
                                    enum:
                                      - 15m
                                      - 1h
                                      - 4h
                                      - 1d
                                  offset:
                                    type: integer
                                    minimum: 0
                                  instrument:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - symbol
                                    properties:
                                      symbol:
                                        type: string
                                        example: BTCUSDT
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - indicator
                                  - args
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - indicator
                                  indicator:
                                    type: string
                                    example: ema
                                  args:
                                    type: object
                                    additionalProperties: true
                                    example:
                                      length: 20
                                  output:
                                    type: string
                                    example: value
                                  timeframe:
                                    type: string
                                    enum:
                                      - 15m
                                      - 1h
                                      - 4h
                                      - 1d
                                  offset:
                                    type: integer
                                    minimum: 0
                                  instrument:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - symbol
                                    properties:
                                      symbol:
                                        type: string
                                        example: BTCUSDT
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - field
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - state
                                  field:
                                    type: string
                                    example: position_exists
                                  offset:
                                    type: integer
                                    minimum: 0
                                  instrument:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - symbol
                                    properties:
                                      symbol:
                                        type: string
                                        example: BTCUSDT
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - op
                                  - period
                                  - source
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - rolling
                                  op:
                                    type: string
                                    enum:
                                      - max
                                      - min
                                      - sum
                                      - avg
                                  period:
                                    type: integer
                                    minimum: 1
                                  source:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                                  offset:
                                    type: integer
                                    minimum: 0
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - op
                                  - args
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - math
                                  op:
                                    type: string
                                    enum:
                                      - add
                                      - sub
                                      - mul
                                      - div
                                      - abs
                                      - min
                                      - max
                                      - pow
                                      - log
                                      - sqrt
                                  args:
                                    type: array
                                    minItems: 1
                                    items:
                                      oneOf:
                                        - type: object
                                          additionalProperties: false
                                          required:
                                            - ref
                                          properties:
                                            ref:
                                              type: string
                                              example: entry_trigger
                                        - type: object
                                          additionalProperties: false
                                          required:
                                            - const
                                          properties:
                                            const:
                                              type: number
                                              example: 20100
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - value
                                  - when
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - capture
                                  value:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                                  when:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - ref
                                    properties:
                                      ref:
                                        type: string
                                        example: entry_trigger
                                  lookback:
                                    type: integer
                                    minimum: 1
                                  offset:
                                    type: integer
                                    minimum: 0
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - items
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - all
                                      - any
                                  items:
                                    type: array
                                    minItems: 1
                                    items:
                                      type: object
                                      additionalProperties: false
                                      required:
                                        - ref
                                      properties:
                                        ref:
                                          type: string
                                          example: entry_trigger
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - item
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - not
                                  item:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - ref
                                    properties:
                                      ref:
                                        type: string
                                        example: entry_trigger
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - op
                                  - left
                                  - right
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - compare
                                  op:
                                    type: string
                                    enum:
                                      - gt
                                      - lt
                                      - gte
                                      - lte
                                      - eq
                                      - neq
                                  left:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                                  right:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - op
                                  - left
                                  - right
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - cross
                                  op:
                                    type: string
                                    enum:
                                      - cross_up
                                      - cross_down
                                  left:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - ref
                                    properties:
                                      ref:
                                        type: string
                                        example: entry_trigger
                                  right:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - value
                                  - lower
                                  - upper
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - between
                                  value:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                                  lower:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                                  upper:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                                  inclusiveLower:
                                    type: boolean
                                  inclusiveUpper:
                                    type: boolean
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - left
                                  - right
                                  - tolerance
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - near
                                  left:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                                  right:
                                    oneOf:
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - ref
                                        properties:
                                          ref:
                                            type: string
                                            example: entry_trigger
                                      - type: object
                                        additionalProperties: false
                                        required:
                                          - const
                                        properties:
                                          const:
                                            type: number
                                            example: 20100
                                  tolerance:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - mode
                                      - value
                                    properties:
                                      mode:
                                        type: string
                                        enum:
                                          - absolute
                                          - percent
                                      value:
                                        type: number
                                        minimum: 0
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - name
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - pattern
                                  name:
                                    type: string
                                    enum:
                                      - doji
                                      - hammer
                                      - shooting_star
                                      - bullish_engulfing
                                      - bearish_engulfing
                                      - morning_star
                                      - evening_star
                                      - three_white_soldiers
                                      - three_black_crows
                                      - bullish_harami
                                      - bearish_harami
                                      - piercing_line
                                      - dark_cloud_cover
                                      - abandoned_baby
                                      - dragonfly_doji
                                      - gravestone_doji
                                      - tweezers_top
                                      - tweezers_bottom
                                      - inside_bar
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - time_window
                                  timezone:
                                    type: string
                                  weekdays:
                                    type: array
                                    items:
                                      type: string
                                      enum:
                                        - Mon
                                        - Tue
                                        - Wed
                                        - Thu
                                        - Fri
                                        - Sat
                                        - Sun
                                  dates:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - start
                                      - end
                                    properties:
                                      start:
                                        type: string
                                        example: '2026-01-01'
                                      end:
                                        type: string
                                        example: '2026-12-31'
                                  between:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - start
                                      - end
                                    properties:
                                      start:
                                        type: object
                                        additionalProperties: false
                                        required:
                                          - hour
                                          - minute
                                        properties:
                                          hour:
                                            type: integer
                                          minute:
                                            type: integer
                                      end:
                                        type: object
                                        additionalProperties: false
                                        required:
                                          - hour
                                          - minute
                                        properties:
                                          hour:
                                            type: integer
                                          minute:
                                            type: integer
                                      inclusive:
                                        type: boolean
                                  at:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - hour
                                      - minute
                                    properties:
                                      hour:
                                        type: integer
                                      minute:
                                        type: integer
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - steps
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - sequence
                                  steps:
                                    type: array
                                    minItems: 1
                                    items:
                                      type: object
                                      additionalProperties: false
                                      required:
                                        - expr
                                      properties:
                                        expr:
                                          type: object
                                          additionalProperties: false
                                          required:
                                            - ref
                                          properties:
                                            ref:
                                              type: string
                                              example: entry_trigger
                                        minBars:
                                          type: integer
                                          minimum: 0
                                        maxBars:
                                          type: integer
                                          minimum: 0
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - window
                                  - mode
                                  - expr
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - rolling_window
                                  window:
                                    type: integer
                                    minimum: 1
                                  mode:
                                    type: string
                                    enum:
                                      - any
                                      - none
                                      - all
                                      - streak
                                      - count_gt
                                      - count_lt
                                      - count_eq
                                  expr:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - ref
                                    properties:
                                      ref:
                                        type: string
                                        example: entry_trigger
                                  value:
                                    type: number
                                    minimum: 0
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - set
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - state_machine
                                  set:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - ref
                                    properties:
                                      ref:
                                        type: string
                                        example: entry_trigger
                                  reset:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - ref
                                    properties:
                                      ref:
                                        type: string
                                        example: entry_trigger
                                  ttlBars:
                                    type: integer
                                    minimum: 1
                                  conflictPolicy:
                                    type: string
                                    enum:
                                      - set_priority
                                      - reset_priority
                          - allOf:
                              - type: object
                                required:
                                  - id
                                  - kind
                                properties:
                                  id:
                                    type: string
                                    example: entry_trigger
                                  kind:
                                    type: string
                                  label:
                                    type: string
                                    example: Breakout trigger
                                  description:
                                    type: string
                                    example: Close above prior breakout level
                              - type: object
                                additionalProperties: false
                                required:
                                  - id
                                  - kind
                                  - name
                                  - params
                                properties:
                                  kind:
                                    type: string
                                    enum:
                                      - event
                                  name:
                                    type: string
                                    enum:
                                      - pivot_confirmed
                                  params:
                                    type: object
                                    additionalProperties: false
                                    required:
                                      - pivotKind
                                      - left
                                      - right
                                    properties:
                                      pivotKind:
                                        type: string
                                        enum:
                                          - high
                                          - low
                                      left:
                                        type: integer
                                        minimum: 1
                                      right:
                                        type: integer
                                        minimum: 1
                                      timeframe:
                                        type: string
                                        enum:
                                          - 15m
                                          - 1h
                                          - 4h
                                          - 1d
                    strategy:
                      type: object
                      additionalProperties: false
                      required:
                        - kind
                        - entry
                      properties:
                        kind:
                          type: string
                          enum:
                            - strategy
                        defaults:
                          type: object
                          additionalProperties: false
                          properties:
                            instrument:
                              type: object
                              additionalProperties: false
                              required:
                                - symbol
                              properties:
                                symbol:
                                  type: string
                                  example: BTCUSDT
                            timeframe:
                              type: string
                              enum:
                                - 15m
                                - 1h
                                - 4h
                                - 1d
                            timezone:
                              type: string
                            warmupBars:
                              type: integer
                              minimum: 0
                            maxConcurrentPositions:
                              type: integer
                              minimum: 1
                        entry:
                          type: object
                          additionalProperties: false
                          required:
                            - kind
                            - trigger
                            - action
                          properties:
                            kind:
                              type: string
                              enum:
                                - entry
                            instrument:
                              type: object
                              additionalProperties: false
                              required:
                                - symbol
                              properties:
                                symbol:
                                  type: string
                                  example: BTCUSDT
                            setup:
                              type: object
                              additionalProperties: false
                              required:
                                - ref
                              properties:
                                ref:
                                  type: string
                                  example: entry_trigger
                            trigger:
                              type: object
                              additionalProperties: false
                              required:
                                - ref
                              properties:
                                ref:
                                  type: string
                                  example: entry_trigger
                            filters:
                              type: array
                              minItems: 1
                              items:
                                type: object
                                additionalProperties: false
                                required:
                                  - ref
                                properties:
                                  ref:
                                    type: string
                                    example: entry_trigger
                            action:
                              type: object
                              additionalProperties: false
                              required:
                                - side
                                - sizing
                              properties:
                                side:
                                  type: string
                                  enum:
                                    - long
                                    - short
                                sizing:
                                  type: object
                                  additionalProperties: false
                                  required:
                                    - mode
                                    - value
                                  properties:
                                    mode:
                                      type: string
                                      enum:
                                        - fixed
                                        - fixed_cash
                                        - percent_equity
                                        - percent_balance
                                    value:
                                      type: number
                                      minimum: 0
                        exits:
                          type: array
                          minItems: 1
                          maxItems: 1
                          items:
                            type: object
                            additionalProperties: false
                            required:
                              - kind
                              - when
                              - action
                            properties:
                              kind:
                                type: string
                                enum:
                                  - exit
                              reason:
                                type: string
                              when:
                                type: object
                                additionalProperties: false
                                required:
                                  - ref
                                properties:
                                  ref:
                                    type: string
                                    example: entry_trigger
                              action:
                                type: object
                                additionalProperties: false
                                required:
                                  - mode
                                  - value
                                properties:
                                  mode:
                                    type: string
                                    enum:
                                      - fixed
                                      - percent_position
                                  value:
                                    type: number
                                    minimum: 0
                              priority:
                                type: integer
                        risk:
                          type: object
                          additionalProperties: false
                          properties:
                            stopLoss:
                              type: object
                              additionalProperties: false
                              required:
                                - mode
                                - value
                              properties:
                                mode:
                                  type: string
                                  enum:
                                    - percent
                                value:
                                  type: number
                                  minimum: 0
                            takeProfits:
                              type: array
                              minItems: 1
                              items:
                                type: object
                                additionalProperties: false
                                required:
                                  - triggerPercent
                                  - closePercent
                                properties:
                                  triggerPercent:
                                    type: number
                                    minimum: 0
                                  closePercent:
                                    type: number
                                    minimum: 0
                                  closeBasis:
                                    type: string
                                    enum:
                                      - initial
                                      - remaining
                                  moveStopToBreakeven:
                                    type: boolean
                            trailingStop:
                              type: object
                              additionalProperties: false
                              required:
                                - distancePercent
                              properties:
                                distancePercent:
                                  type: number
                                  minimum: 0
                                activateAfterPercent:
                                  type: number
                                  minimum: 0
                  example:
                    protocol: traseq.signal-graph
                    version: 2
                    nodes:
                      - id: close_price
                        kind: market
                        field: close
                      - id: breakout_level
                        kind: const
                        value: 20100
                      - id: breakout_trigger
                        kind: compare
                        op: gt
                        left:
                          ref: close_price
                        right:
                          ref: breakout_level
                    strategy:
                      kind: strategy
                      entry:
                        kind: entry
                        trigger:
                          ref: breakout_trigger
                        action:
                          side: long
                          sizing:
                            mode: fixed
                            value: 1
                  description: >-
                    Higher-level AI agent authoring graph. The backend compiles
                    this to canonical strategyAst before validation and
                    persistence.
                settings:
                  type: object
                  additionalProperties: false
                  properties:
                    maxConcurrentPositions:
                      type: integer
                      minimum: 1
                      maximum: 100
                      example: 1
                    warmupPeriod:
                      type: integer
                      minimum: 0
                      example: 200
      responses:
        '200':
          description: Strategy version finalized
      security:
        - traseq-api-key: []
components:
  securitySchemes:
    traseq-api-key:
      type: apiKey
      in: header
      name: x-api-key
      description: Workspace API key for public agent API access

````