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

# Get OHLCV candles with technical analysis

> Fetches candles like `GET /symbols/{symbol}/rates` (same query params), then forwards them to the candlewick TA sidecar for indicator calculation. Returns both bars and TA results.



## OpenAPI

````yaml https://terminal-api.novosky.tech/roboforex/main/openapi.json post /symbols/{symbol}/rates/ta
openapi: 3.0.3
info:
  description: >-
    Self-hosted HTTP REST API bridging the NOVOSKY trading bot to a MetaTrader 5
    terminal. All bot-to-broker communication goes through this service.
    Authentication is required on all endpoints except `GET /ping`.
  title: MT5 HEADLESS
  version: 1.0.0
servers:
  - url: /
security:
  - bearerAuth: []
tags:
  - description: Health, latency, and error diagnostics
    name: System
  - description: MT5 terminal lifecycle and server time
    name: Terminal
  - description: Broker server time and UTC offset detection
    name: Time
  - description: Live balance, equity, and margin
    name: Account
  - description: Symbol specs, ticks, and OHLCV rates
    name: Symbols
  - description: Open position management
    name: Positions
  - description: Pending order placement and management
    name: Orders
  - description: Closed deals and historical orders
    name: History
paths:
  /symbols/{symbol}/rates/ta:
    post:
      tags:
        - Symbols
      summary: Get OHLCV candles with technical analysis
      description: >-
        Fetches candles like `GET /symbols/{symbol}/rates` (same query params),
        then forwards them to the candlewick TA sidecar for indicator
        calculation. Returns both bars and TA results.
      operationId: get_rates_ta
      parameters:
        - description: Symbol name
          in: path
          name: symbol
          required: true
          schema:
            example: BTCUSD
            type: string
        - description: 'MT5 timeframe: M1 M5 M15 M30 H1 H4 D1 W1 MN1'
          in: query
          name: timeframe
          required: false
          schema:
            default: M1
            example: M15
            type: string
        - description: Number of candles
          in: query
          name: count
          required: false
          schema:
            default: 100
            example: 500
            type: integer
      requestBody:
        content:
          application/json:
            schema:
              properties:
                indicators:
                  additionalProperties: true
                  description: >-
                    Candlewick indicator spec (e.g. {"rsi": {"period": 14},
                    "ema": {"period": 21}}).
                  type: object
                recentBars:
                  description: Only return TA for the N most recent bars.
                  example: 50
                  type: integer
              required:
                - indicators
              type: object
        required: true
      responses:
        '200':
          content:
            application/json:
              schema:
                properties:
                  bars:
                    items:
                      $ref: '#/components/schemas/RateResponse'
                    type: array
                  symbol:
                    type: string
                  ta:
                    additionalProperties: true
                    nullable: true
                    type: object
                  timeframe:
                    type: string
                type: object
          description: Bars with TA analysis
        '400':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing or invalid indicators body
        '401':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Missing or invalid Bearer token
        '502':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: Candlewick sidecar unavailable or rejected request
        '503':
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
          description: MT5 not initialized
components:
  schemas:
    RateResponse:
      additionalProperties: true
      description: A single OHLCV candle.
      properties:
        close:
          example: 95050
          type: number
        high:
          example: 95200
          type: number
        low:
          example: 94900
          type: number
        open:
          example: 95000
          type: number
        real_volume:
          example: 0
          type: integer
        spread:
          description: >-
            Spread in raw points. For BTCUSD on RoboForex: 1459 pts × $0.01 =
            $14.59 round-turn.
          example: 1459
          type: integer
        tick_volume:
          example: 1234
          type: integer
        time:
          description: Candle open time as Unix epoch (broker server time).
          example: 1777879200
          type: integer
      type: object
    ErrorResponse:
      additionalProperties: true
      description: MT5 error payload returned on non-2xx responses.
      properties:
        message:
          example: Invalid stops
          type: string
        retcode:
          description: MT5 error code (e.g. 10014 = invalid stops, 10018 = market closed).
          example: 10014
          type: integer
      type: object
  securitySchemes:
    bearerAuth:
      description: Set `API_TOKEN` in `.env` to match the token configured on the server.
      scheme: bearer
      type: http

````