DriveWealth Charts API

The Charts API from DriveWealth — 1 operation(s) for charts.

OpenAPI Specification

drivewealth-charts-api-openapi.yml Raw ↑
openapi: 3.0.2
info:
  title: DriveWealth Accounts Charts API
  version: '1.0'
servers:
- url: https://bo-api.drivewealth.io/back-office
  description: Sandbox server (Uses test data)
- url: https://bo-api.drivewealth.net/back-office
  description: Production Server (Uses LIVE data)
tags:
- name: Charts
  x-displayName: Charts
paths:
  /bars:
    get:
      deprecated: true
      tags:
      - Charts
      parameters:
      - in: query
        name: instrumentID
        schema:
          type: string
        required: true
        example: 3fb1e8a9-f7d5-4d90-95e2-43e7326b5636
        description: A unique ID created by DriveWealth to identify a specific instrument.
      - in: query
        name: compression
        schema:
          type: string
          enum:
          - '0'
          - '1'
          - '4'
          - '8'
          - '9'
          - '10'
        required: true
        example: '9'
        description: The compression number represents the time increments of the chart data. Refer to the Compression table above.
      - in: query
        name: dateStart
        schema:
          type: string
        required: true
        example: '2022-11-10T00:00:00Z'
        description: The start date of the chart data. Follow ISO-8601 format.
      - in: query
        name: dateEnd
        schema:
          type: string
        required: true
        example: '2022-11-18T23:59:00Z'
        description: The end date of the chart data. Follow ISO-8601 format.
      - in: query
        name: tradingDays
        schema:
          type: string
        required: false
        example: '20'
        description: TradingDays may be defined as 1-60 days in the past from the current date. If set do not use `dateStart` and `dateEnd` values.
      summary: Retrieve Chart
      description: Fetch historical bars for a given instrument over a given time period.
      responses:
        '200':
          description: Fetching Chart details was successful.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/Bars'
        '400':
          description: Bad Request
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
              examples:
                Invalid request for daily bars:
                  value:
                    errorCode: B100
                    message: The number of bars requested has exceeded the maximum allowed of 10 Years for Daily bars.
                Invalid request for one minute bars:
                  value:
                    errorCode: B100
                    message: The number of bars requested has exceeded the maximum allowed of 1 Month for 1 minute bars.
                Invalid request for five minutes bars:
                  value:
                    errorCode: B100
                    message: The number of bars requested has exceeded the maximum allowed of 2 Months for 5 minutes bars.
                Invalid request for thirty minutes bars:
                  value:
                    errorCode: B100
                    message: The number of bars requested has exceeded the maximum allowed of 1 Year for 30 minutes bars.
                Invalid request for one hour bars:
                  value:
                    errorCode: B100
                    message: The number of bars requested has exceeded the maximum allowed of 2 Years for 1 hour bars.
                Invalid request for weekly bars:
                  value:
                    errorCode: B100
                    message: The number of bars requested has exceeded the maximum allowed of 20 Years for Weekly bars.
                Invalid request:
                  value:
                    errorCode: E033
                    message: Invalid parameter in message body. Refer to the API documentation for details.
        '500':
          description: Internal Server Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponseModel'
              examples:
                OneTick bars request exceeded:
                  value:
                    errorCode: OT002
                    message: The Number of Bars request has exceeded the maximum allowed Bars.
                Other OneTick Errors:
                  value:
                    errorCode: OT003
                    message: Unable to retrieve bars data.
      security:
      - bearerAuth: []
        dwAppKey: []
      - sessionToken: []
        dwAppKey: []
components:
  schemas:
    ErrorCode:
      type: string
      description: The error code that is returned when an error occurs.
      example: E032
    instrumentID:
      type: string
      format: uuid
      example: 3fb1e8a9-f7d5-4d90-95e2-43e7326b5636
      description: 'A unique ID created by DriveWealth to identify a specific instrument. '
    Bars:
      type: object
      properties:
        instrumentID:
          $ref: '#/components/schemas/instrumentID'
        compression:
          type: number
          example: 9
          description: The compression value represents the time increments  of the chart data. Refer to the compression table for the value descriptions.
          enum:
          - 0
          - 1
          - 4
          - 8
          - 9
          - 10
        dateStart:
          type: string
          example: '2022-11-10T00:00:00Z'
          description: The start date of the chart data.
        dateEnd:
          type: string
          example: '2022-11-18T23:59:00Z'
          description: The end date of the chart data.
        data:
          type: string
          example: 2022-11-10T15:00:00Z,86.87,87.96,86.78,87.91,95568|2022-11-10T16:00:00Z,87.875,87.96,86.9,87.36,107004|2022-11-10T17:00:00Z,87.41,88.09,87.27,88.03,85171|2022-11-10T18:00:00Z,88.03,88.12,87.755,87.755,44808|2022-11-10T19:00:00Z,87.74,88.35,87.74,88.28,45755|2022-11-10T20:00:00Z,88.27,88.47,88.12,88.46,44391|2022-11-10T21:00:00Z,88.44,88.98,88.4,88.79,177251|2022-11-11T15:00:00Z,89.15,90.22,89.13,90.19,65167|2022-11-11T16:00:00Z,90.15,91.68,89.81,91.35,122906|2022-11-11T17:00:00Z,91.47,91.51,90.01,90.26,60692|2022-11-11T18:00:00Z,90.22,90.31,89.895,90.28,34462|2022-11-11T19:00:00Z,90.28,90.9,90.28,90.9,33509|2022-11-11T20:00:00Z,90.93,91.44,90.91,91.38,72687|2022-11-11T21:00:00Z,91.37,91.37,90.7,90.79,123926|2022-11-14T15:00:00Z,90.11,90.62,89.97,90.23,28369|2022-11-14T16:00:00Z,90.4,90.62,90.02,90.45,50923|2022-11-14T17:00:00Z,90.47,90.63,90.05,90.33,37863|2022-11-14T18:00:00Z,90.4,90.9,90.27,90.86,34006|2022-11-14T19:00:00Z,90.85,91.345,90.85,91.345,28538|2022-11-14T20:00:00Z,91.33,91.35,90.7,90.77,40253|2022-11-14T21:00:00Z,90.72,90.85,89.79,89.82,52283|2022-11-15T15:00:00Z,91.06,91.83,90.77,91.49,67238|2022-11-15T16:00:00Z,91.5,91.69,91.06,91.06,67885|2022-11-15T17:00:00Z,91.01,91.35,90.9,90.97,36514|2022-11-15T18:00:00Z,91.02,91.06,90.68,90.89,33116|2022-11-15T19:00:00Z,90.88,90.96,89.39,90.03,68627|2022-11-15T20:00:00Z,89.99,90.82,89.82,90.585,71247|2022-11-15T21:00:00Z,90.63,90.71,90.2,90.485,81118|2022-11-16T15:00:00Z,90.22,90.34,89.81,89.89,34416|2022-11-16T16:00:00Z,89.915,90.31,89.42,89.43,55055|2022-11-16T17:00:00Z,89.43,89.83,89.08,89.83,40326|2022-11-16T18:00:00Z,89.82,90.08,89.6,89.86,24222|2022-11-16T19:00:00Z,89.77,89.77,89.56,89.56,22107|2022-11-16T20:00:00Z,89.54,89.82,89.47,89.77,28389|2022-11-16T21:00:00Z,89.75,89.91,89.43,89.82,65605|2022-11-17T15:00:00Z,88.6,88.76,87.58,87.58,27525|2022-11-17T16:00:00Z,87.56,88.24,87.53,87.83,77796|2022-11-17T17:00:00Z,87.81,88.46,87.78,88.43,49492|2022-11-17T18:00:00Z,88.59,89.06,88.52,89.05,25378|2022-11-17T19:00:00Z,89.07,89.07,88.75,88.78,21474|2022-11-17T20:00:00Z,88.79,88.9,88.56,88.68,27020|2022-11-17T21:00:00Z,88.66,88.97,88.37,88.95,62714|2022-11-18T15:00:00Z,90.27,90.28,89.49,89.55,21160|2022-11-18T16:00:00Z,89.57,89.57,89.16,89.21,44798|2022-11-18T17:00:00Z,89.23,89.46,89.06,89.17,28915|2022-11-18T18:00:00Z,89.18,89.18,88.6,88.82,38268|2022-11-18T19:00:00Z,88.85,89.23,88.81,88.94,19097|2022-11-18T20:00:00Z,89.0,89.39,89.0,89.2,45037|2022-11-18T21:00:00Z,89.19,89.53,88.96,89.23,93566
          description: 'The `data` attribute holds each chart value separated by a pipe ''|''. Each data set is preceded by the date, followed by the pricing data in the following order: Open, High, Low, Close, Volume.'
    ErrorCodeMessage:
      type: string
      description: The error message that is returned when an error occurs.
    ErrorDetails:
      type: object
      properties:
        field:
          type: string
          description: JSON field name from the request body that caused an error
        type:
          type: string
          enum:
          - STRING
          - ARRAY
          - INT
          - DECIMAL
          - BOOL
          - TEXT
          - UUID
          - DATE
          - MAP
          - OBJECT
          description: Expected data type of the field
        allowedValues:
          type: string
          description: Example values which are allowed in the field
    ErrorResponseModel:
      type: object
      description: The error response model that is returned when an error occurs.
      required:
      - errorCode
      - message
      properties:
        errorCode:
          $ref: '#/components/schemas/ErrorCode'
        message:
          $ref: '#/components/schemas/ErrorCodeMessage'
        errorDetails:
          $ref: '#/components/schemas/ErrorDetails'
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
    dwAppKey:
      type: apiKey
      in: header
      name: dw-client-app-key
    sessionToken:
      type: apiKey
      in: header
      name: dw-auth-token