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

# Hedge trade

> Open opposing positions on a prop account and a personal broker account simultaneously.
The prop account gets the directional trade, the broker account gets the opposite side.




## OpenAPI

````yaml /openapi-spec/easierprop.yaml post /api/hedge
openapi: 3.0.3
info:
  title: Easier Prop REST API
  version: 2.1.0
  description: >
    MT5 Trading Infrastructure API. Manage multiple broker accounts, execute
    trades, stream market data, and administer API keys, usage snapshots, and
    billing terms.


    **Client API** endpoints live under `/api` and require an `X-API-Key`
    header.

    **Admin API** endpoints live under `/admin` and accept either a JWT
    `Authorization: Bearer <jwt>` (obtained via `/admin/login`) or the same
    `X-API-Key` header used by client endpoints.


    Admin user provisioning is read-only via REST: `GET /admin/admins` lists
    admins, but creation, update, and deletion are performed out-of-band (DB /
    ops tooling). Bootstrap a brand-new deployment with `POST /admin/seed` while
    no superadmin exists.
servers:
  - url: https://api.easierprop.com
    description: Production
security: []
tags:
  - name: Admin
    description: Authentication, API key management, and admin user CRUD
  - name: Accounts
    description: Register and manage MT5 broker accounts
  - name: Sessions
    description: Control broker connections
  - name: Trading
    description: Place, modify, and close orders
  - name: Account Info
    description: Balance, equity, margin, and statistics
  - name: Market Data
    description: Symbols, quotes, OHLC history, and trade sessions
  - name: Expert Advisors
    description: Upload, run, stop, and monitor MQL5 Expert Advisors on your accounts
  - name: Enhanced
    description: >-
      Portfolio, risk, performance, copy-trade, hedge, breakeven, close-all, lot
      calculator, and position details
  - name: Extended
    description: >-
      Change password, server timezone, symbol sessions, closed positions,
      mails, tick value, equity stats, and more
paths:
  /api/hedge:
    post:
      tags:
        - Enhanced
      summary: Hedge trade
      description: >
        Open opposing positions on a prop account and a personal broker account
        simultaneously.

        The prop account gets the directional trade, the broker account gets the
        opposite side.
      operationId: hedge
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/HedgeRequest'
      responses:
        '200':
          description: Hedge result
          content:
            application/json:
              schema:
                type: object
                properties:
                  ok:
                    type: boolean
                    example: true
                  data:
                    $ref: '#/components/schemas/HedgeResult'
      security:
        - ApiKeyHeader: []
components:
  schemas:
    HedgeRequest:
      type: object
      required:
        - prop_account_id
        - broker_account_id
        - symbol
        - direction
        - prop_lots
        - broker_lots
      properties:
        prop_account_id:
          type: string
          format: uuid
          description: Prop firm account ID
        broker_account_id:
          type: string
          format: uuid
          description: Personal broker account ID
        symbol:
          type: string
          example: EURUSD
        direction:
          type: string
          enum:
            - long
            - short
          example: long
        prop_lots:
          type: number
          description: Lot size for the prop account
          example: 0.1
        broker_lots:
          type: number
          description: Lot size for the broker account
          example: 0.1
        sl:
          type: number
          description: Stop loss price
        tp:
          type: number
          description: Take profit price
        comment:
          type: string
          description: Order comment
    HedgeResult:
      type: object
      properties:
        prop_ticket:
          type: integer
          format: int64
          example: 12345678
        broker_ticket:
          type: integer
          format: int64
          example: 87654321
        prop_result:
          type: object
        broker_result:
          type: object
        success:
          type: boolean
          example: true
        message:
          type: string
          example: Both orders executed
  securitySchemes:
    ApiKeyHeader:
      type: apiKey
      in: header
      name: X-API-Key
      description: |
        Client API key (prefixed with `sk_`). On `/api/*` endpoints the key
        is scoped to its own MT5 accounts. On `/admin/*` endpoints the key
        identifies its **owning admin** and grants access to all of that
        admin's keys — so any of your `sk_` works to manage any of your
        other keys (cross-admin operations are rejected as `400 Key not
        found`).

````