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

# Lịch sử OHLC



## OpenAPI

````yaml /vi/openapi/dnse.2026-09-25.openapi.yaml get /price/ohlc
openapi: 3.0.0
info:
  title: DNSE OpenAPI (2026-09-25)
  version: 2.0.0
  description: DNSE OpenAPI spec
servers:
  - url: https://openapi.dnse.com.vn
    description: Production
  - url: https://sb-openapi.dnse.com.vn
    description: Sanbox
security: []
tags:
  - name: trading
    description: Xác thực và các hoạt động đặt lệnh.
    x-group: Giao dịch
  - name: account
    description: Tài khoản, số dư, khoản vay, lệnh và vị thế.
    x-group: Tài khoản
  - name: market
    description: Thông tin mã chứng khoán, báo giá, OHLC và giao dịch.
    x-group: Dữ liệu thị trường
paths:
  /price/ohlc:
    get:
      tags:
        - market
      summary: Lịch sử OHLC
      operationId: symbol_getOhlc
      parameters:
        - $ref: '#/components/parameters/XApiKey'
        - $ref: '#/components/parameters/XAuxDate'
        - $ref: '#/components/parameters/XSignature'
        - name: symbol
          in: query
          required: true
          description: 'Mã chứng khoán '
          deprecated: false
          schema:
            type: string
          example: ACB
        - name: type
          in: query
          required: true
          description: |-
            Loại thị trường
            - STOCK: Cổ phiếu
            - DERIVATIVE: Phái sinh
            - INDEX: Chỉ số thị trường
          deprecated: false
          schema:
            $ref: '#/components/schemas/Type'
          example: STOCK
        - name: resolution
          in: query
          required: true
          description: |-
            Khung thời gian nến
            - 1,3,5,15,30,1h,1D,1W
          deprecated: false
          schema:
            $ref: '#/components/schemas/Resolution'
          example: '15'
        - name: from
          in: query
          required: true
          description: Thời gian bắt đầu
          deprecated: false
          schema:
            type: string
          example: '1773657310'
        - name: to
          in: query
          required: true
          description: Thời gian kết thúc
          deprecated: false
          schema:
            type: string
          example: '1773830110'
      responses:
        '200':
          description: OK
          headers:
            Content-Length:
              $ref: '#/components/headers/ContentLength'
            Date:
              $ref: '#/components/headers/Date'
            Vary:
              $ref: '#/components/headers/Vary'
            X-Content-Type-Options:
              $ref: '#/components/headers/XContentTypeOptions'
            X-Frame-Options:
              $ref: '#/components/headers/XFrameOptions'
            X-Ratelimit-Limit:
              $ref: '#/components/headers/XRateLimitLimit'
            X-Ratelimit-Remaining:
              $ref: '#/components/headers/XRateLimitRemaining'
            X-Ratelimit-Reset:
              $ref: '#/components/headers/XRateLimitReset'
            X-Request-Id:
              $ref: '#/components/headers/XRequestId'
            X-Tyk-Api-Expires:
              deprecated: false
              schema: {}
              example: Thu, 02 Jan 3000 15:04:00 UTC
            X-Xss-Protection:
              $ref: '#/components/headers/XXssProtection'
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/OhlcResponse'
              example:
                t:
                  - 1773715500
                  - 1773716400
                  - 1773800100
                  - 1773801000
                  - 1773801900
                  - 1773802800
                  - 1773803700
                  - 1773804600
                  - 1773805500
                  - 1773806400
                o:
                  - 23.8
                  - 23.75
                  - 23.75
                  - 23.85
                  - 23.8
                  - 23.85
                  - 23.9
                  - 23.75
                  - 23.8
                  - 23.8
                h:
                  - 23.8
                  - 23.8
                  - 23.9
                  - 23.9
                  - 23.85
                  - 23.9
                  - 23.9
                  - 23.85
                  - 23.8
                  - 23.8
                l:
                  - 23.7
                  - 23.7
                  - 23.7
                  - 23.8
                  - 23.75
                  - 23.8
                  - 23.7
                  - 23.75
                  - 23.7
                  - 23.75
                c:
                  - 23.75
                  - 23.75
                  - 23.8
                  - 23.85
                  - 23.8
                  - 23.9
                  - 23.85
                  - 23.75
                  - 23.75
                  - 23.75
                v:
                  - 2530900
                  - 514100
                  - 494000
                  - 344400
                  - 429000
                  - 315300
                  - 582100
                  - 205300
                  - 361300
                  - 3040800
                nextTime: 0
        '400':
          $ref: '#/components/responses/BadRequest'
        '500':
          $ref: '#/components/responses/InternalError'
components:
  parameters:
    XApiKey:
      name: X-Api-Key
      in: header
      required: true
      description: >-
        API key được cấp khi đăng ký dịch vụ DNSE OpenAPI.

        Ví dụ:
        `b3JnOmRuc2UgaWQ6MjdlZTc1MzcxZGFkNTY0NmYzYTM2NDk1ZGE3OGNiOGQgaDptdXJtdXIxMjg=`
      schema:
        type: string
    XAuxDate:
      name: X-Aux-Date
      in: header
      required: true
      description: |-
        Thời gian thực hiện request, dùng trong cơ chế ký request của DNSE.
        Ví dụ: `Sat, 01 May 2026 14:24:23 +0000`
      schema:
        type: string
    XSignature:
      name: X-Signature
      in: header
      required: true
      description: >-
        Chữ ký xác thực request được tạo từ API key secret và X-Aux-Date.

        Ví dụ: `Signature
        keyId="b3JnOmRuc2UgaWQ6MjdlZTc1MzcxZGFkNTY0NmYzYTM2NDk1ZGE3OGNiOGQgaDptdXJtdXIxMjg=",algorithm="hmac-sha256",headers="(request-target)
        x-aux-date",signature="rfbVXHDUi%2B%2FsOkLXle7O17Qm%2F05cbISSR%2BDcFrBHfqQ%3D",nonce="4add8c3264e4492b9f8ecde0cf26b523"`
      schema:
        type: string
  schemas:
    Type:
      type: string
      description: |-
        Loại nhóm thị trường.

        - `STOCK`: Cổ phiếu
        - `DERIVATIVE`: Phái sinh
        - `INDEX`: Chỉ số
      enum:
        - STOCK
        - DERIVATIVE
        - INDEX
      x-enum-descriptions:
        - Cổ phiếu
        - Phái sinh
        - Chỉ số
      x-enum-varnames:
        - STOCK
        - DERIVATIVE
        - INDEX
      example: STOCK
    Resolution:
      type: string
      description: |-
        Khung thời gian nến.

        - `1`: 1 phút
        - `3`: 3 phút
        - `5`: 5 phút
        - `15`: 15 phút
        - `30`: 30 phút
        - `1H`: 1 giờ
        - `1D`: 1 ngày
        - `1W`: 1 tuần
      enum:
        - '1'
        - '3'
        - '5'
        - '15'
        - '30'
        - 1H
        - 1D
        - 1W
      x-enum-descriptions:
        - 1 phút
        - 3 phút
        - 5 phút
        - 15 phút
        - 30 phút
        - 1 giờ
        - 1 ngày
        - 1 tuần
      x-enum-varnames:
        - M1
        - M3
        - M5
        - M15
        - M30
        - H1
        - D1
        - W1
      example: '15'
    OhlcResponse:
      type: object
      properties:
        t:
          type: array
          example:
            - 1773715500
          items:
            type: integer
            format: int32
            example: 1773715500
            description: Thời gian nến (timestamp)
          description: Danh sách thời gian nến
        o:
          type: array
          example:
            - 23.8
          items:
            type: number
            format: double
            example: 23.8
            description: Giá mở cửa của nến
          description: Danh sách giá mở cửa của nến theo thời gian tương ứng
        h:
          type: array
          example:
            - 23.8
          items:
            type: number
            format: double
            example: 23.8
            description: Giá cao nhất trong nến
          description: Danh sách giá cao nhất trong nến theo thời gian tương ứng
        l:
          type: array
          example:
            - 23.7
          items:
            type: number
            format: double
            example: 23.7
            description: Giá thấp nhất trong nến
          description: Danh sách giá thấp nhất trong nến theo thời gian tương ứng
        c:
          type: array
          example:
            - 23.75
          items:
            type: number
            format: float
            example: 23.75
            description: Giá đóng cửa của nến
          description: Danh sách giá đóng cửa của nến theo thời gian tương ứng
        v:
          type: array
          example:
            - 2530900
          items:
            type: integer
            format: int32
            example: 2530900
            description: Khối lượng giao dịch
          description: Danh sách khối lượng giao dịch theo thời gian tương ứng
        nextTime:
          type: integer
          format: int32
          example: 0
          description: Timestamp của cây nến tiếp theo (nếu có), 0 nếu không còn
      description: Dữ liệu biểu đồ nến (OHLCV) theo từng khoảng thời gian.
      required:
        - t
        - o
        - h
        - l
        - c
        - v
        - nextTime
      example:
        t:
          - 1773715500
          - 1773716400
          - 1773800100
        o:
          - 23.8
          - 23.75
          - 23.75
        h:
          - 23.8
          - 23.8
          - 23.9
        l:
          - 23.7
          - 23.7
          - 23.7
        c:
          - 23.75
          - 23.75
          - 23.8
        v:
          - 2530900
          - 514100
          - 494000
        nextTime: 0
    ErrorBody:
      type: object
      required:
        - status
        - code
        - message
      properties:
        status:
          type: integer
          format: int32
          description: Mã HTTP.
          example: 400
        code:
          type: string
          description: Mã lỗi DNSE.
          example: OA-003
        message:
          type: string
          description: Thông điệp lỗi.
          example: Thông tin nhập không hợp lệ
  headers:
    ContentLength:
      description: Response body size in bytes.
      schema:
        type: integer
      example: 430
    Date:
      description: Response date from the DNSE gateway.
      schema:
        type: string
      example: Wed, 18 Mar 2026 16:17:35 GMT
    Vary:
      description: >-
        Response header indicating the request headers used for content
        negotiation.
      schema:
        type: string
      example: Origin
    XContentTypeOptions:
      description: Header that prevents MIME type sniffing.
      schema:
        type: string
      example: nosniff
    XFrameOptions:
      description: Clickjacking protection header returned by the gateway.
      schema:
        type: string
      example: GOFORIT
    XRateLimitLimit:
      description: Maximum number of requests allowed in the current rate-limit window.
      schema:
        type: integer
      example: 300
    XRateLimitRemaining:
      description: Number of requests remaining in the current rate-limit window.
      schema:
        type: integer
      example: 299
    XRateLimitReset:
      description: Unix timestamp at which the current rate-limit window resets.
      schema:
        type: integer
      example: 1773850655
    XRequestId:
      description: Unique identifier assigned to the request by the DNSE gateway.
      schema:
        type: string
      example: unknown
    XXssProtection:
      description: Browser XSS protection header returned by the gateway.
      schema:
        type: string
      example: 0
  responses:
    BadRequest:
      description: Yêu cầu không hợp lệ.
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLength'
        Date:
          $ref: '#/components/headers/Date'
        Vary:
          $ref: '#/components/headers/Vary'
        X-Ratelimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-Ratelimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-Ratelimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Tyk-Api-Expires:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            status: 400
            code: OA-003
            message: Thông tin nhập không hợp lệ
    InternalError:
      description: Lỗi hệ thống.
      headers:
        Content-Length:
          $ref: '#/components/headers/ContentLength'
        Date:
          $ref: '#/components/headers/Date'
        Vary:
          $ref: '#/components/headers/Vary'
        X-Ratelimit-Limit:
          $ref: '#/components/headers/XRateLimitLimit'
        X-Ratelimit-Remaining:
          $ref: '#/components/headers/XRateLimitRemaining'
        X-Ratelimit-Reset:
          $ref: '#/components/headers/XRateLimitReset'
        X-Request-Id:
          $ref: '#/components/headers/XRequestId'
        X-Tyk-Api-Expires:
          schema:
            type: string
      content:
        application/json:
          schema:
            $ref: '#/components/schemas/ErrorBody'
          example:
            status: 500
            code: OA-009
            message: Lỗi hệ thống

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.