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

# Update a pending trade to closed

> Update a pending trade with exit information.



## OpenAPI

````yaml /api/openapi.json patch /api/uat/v1/trades/{outcome_id}
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/uat/v1/trades/{outcome_id}:
    patch:
      tags:
        - UAT Testing
      summary: Update a pending trade to closed
      description: Update a pending trade with exit information.
      operationId: update_trade_api_uat_v1_trades__outcome_id__patch
      parameters:
        - name: outcome_id
          in: path
          required: true
          schema:
            type: string
            format: uuid
            title: Outcome Id
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/TradeOutcomeUpdate'
      responses:
        '200':
          description: Successful Response
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/TradeOutcome'
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    TradeOutcomeUpdate:
      properties:
        outcome_id:
          type: string
          format: uuid
          title: Outcome Id
        exit_time:
          type: string
          format: date-time
          title: Exit Time
        exit_price:
          anyOf:
            - type: number
              exclusiveMinimum: 0
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Exit Price
        pnl_dollars:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Pnl Dollars
        pnl_percent:
          anyOf:
            - type: number
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Pnl Percent
      type: object
      required:
        - outcome_id
        - exit_time
        - exit_price
        - pnl_dollars
      title: TradeOutcomeUpdate
      description: Request model for updating a pending trade to closed.
    TradeOutcome:
      properties:
        outcome_id:
          type: string
          format: uuid
          title: Outcome Id
        entry_time:
          type: string
          format: date-time
          title: Entry Time
        exit_time:
          anyOf:
            - type: string
              format: date-time
            - type: 'null'
          title: Exit Time
        recorded_at:
          type: string
          format: date-time
          title: Recorded At
        trade_status:
          $ref: '#/components/schemas/TradeStatus'
        scan_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Scan Id
        action_card_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Action Card Id
        position_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Position Id
        variant_id:
          anyOf:
            - type: string
              format: uuid
            - type: 'null'
          title: Variant Id
        tradestation_order_id:
          anyOf:
            - type: string
            - type: 'null'
          title: Tradestation Order Id
        symbol:
          type: string
          title: Symbol
        direction:
          $ref: '#/components/schemas/app__models__uat__TradeDirection'
        entry_price:
          type: string
          pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
          title: Entry Price
        exit_price:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Exit Price
        quantity:
          type: integer
          title: Quantity
        pnl_dollars:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Pnl Dollars
        pnl_percent:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Pnl Percent
        is_winner:
          anyOf:
            - type: boolean
            - type: 'null'
          title: Is Winner
        hold_duration_m:
          anyOf:
            - type: integer
            - type: 'null'
          title: Hold Duration M
        confluence_tier:
          anyOf:
            - $ref: '#/components/schemas/app__models__uat__ConfluenceTier'
            - type: 'null'
        confluence_score:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Confluence Score
        net_confluence:
          anyOf:
            - type: string
              pattern: ^(?!^[-+.]*$)[+-]?0*\d*\.?\d*$
            - type: 'null'
          title: Net Confluence
        directional_bias:
          anyOf:
            - type: string
            - type: 'null'
          title: Directional Bias
        day_type:
          anyOf:
            - type: string
            - type: 'null'
          title: Day Type
        vix_regime:
          anyOf:
            - type: string
            - type: 'null'
          title: Vix Regime
        account_tier:
          anyOf:
            - type: integer
            - type: 'null'
          title: Account Tier
        outcome_source:
          $ref: '#/components/schemas/OutcomeSource'
      type: object
      required:
        - outcome_id
        - entry_time
        - exit_time
        - recorded_at
        - trade_status
        - scan_id
        - action_card_id
        - position_id
        - variant_id
        - tradestation_order_id
        - symbol
        - direction
        - entry_price
        - exit_price
        - quantity
        - pnl_dollars
        - pnl_percent
        - is_winner
        - hold_duration_m
        - confluence_tier
        - confluence_score
        - day_type
        - vix_regime
        - account_tier
        - outcome_source
      title: TradeOutcome
      description: Full trade outcome model with server-generated fields.
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    TradeStatus:
      type: string
      enum:
        - pending
        - closed
        - cancelled
      title: TradeStatus
      description: Trade lifecycle status.
    app__models__uat__TradeDirection:
      type: string
      enum:
        - long
        - short
      title: TradeDirection
      description: 'Trade direction: long or short.'
    app__models__uat__ConfluenceTier:
      type: string
      enum:
        - EXCELLENT
        - GOOD
        - MODERATE
        - WEAK
        - POOR
      title: ConfluenceTier
      description: Confluence tier classification.
    OutcomeSource:
      type: string
      enum:
        - tradestation_api
        - manual_cli
        - journal_import
      title: OutcomeSource
      description: Source of trade outcome data.
    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

````