Market Data Documentation
  • Introduction
  • Technical Guidelines
  • Market Data APIs
    • Market Data API
      • Partial Order Book
      • Light Tickers
      • Live Trades
      • Auction Indicative Equilibrium Price
      • Candles
      • Get Settlement Prices
      • Instrument List
      • Calendar List
      • Tick Size List
  • Release Notes
    • API Changes
Powered by GitBook
On this page
  • Request
  • Response
  • Error Codes
  • Samples
  1. Market Data APIs
  2. Market Data API

Candles

This API disseminates aggregated data on different time resolutions. It supports retrieving data for a given period or as a continuous stream. Updates are disseminated every 3 seconds (only in case of a change) or when the candle is closed.

Response description

For real time updates qualifier:

  • to is ignored

  • When from was not sent: only new streaming messages will be sent

  • When only from was sent - candles from that point will be returned, stream will remain open for the new streamed messages to come

For historical data qualifier: from & to must be sent

  • from & to must be sent: candles from that period will be returned, stream will be closed after last message.

    • In case there are no candles in range, system will return 1 candle which is the last candle prior to range (just before the “from”)

This API is non real-time but close to real-time.

below fields of the response are adjusted for Corporate Actions:

  • open

  • close

  • high

  • low

  • volume

  • vwa

Real time updates qualifier: v1/exchange.marketdata/candles

Historical data qualifier: v1/exchange.marketdata.history/candles

Request

Parameter
Type
Description

symbol

String

Symbol to retrieve the candles

from optional

Int or Unix timestamp

Candles start from

format: if timespan=DAY: yyyyMMdd else epoch time in seconds

to optional

Int or Unix timestamp

Candles to

Same format as from, refer description of from for more details.

timespan

eNum

One of below values:

MINUTE - flat min (from 00 seconds to 59.999 seconds)

HOUR- based on minute candle and equal to 60 min

DAY - Based on trade date (starts on calendar time zone midnight)

multiplier optional

Int

Timespan multiplier, if not sent: 1 is default value. Allowed intervals:

  • 1 MINUTE

  • 5 MINUTE

  • 15 MINUTE

  • 1 HOUR

  • 4 HOUR

  • 1 DAY

caAdjustments

Boolean

Optional

If not exist, caAdjustments=false

Whether historical prices should be adjusted for corporate actions. Refer Admin API to create adjustment factors.

Applicable only to history API (exchange.marketdata.history/candles)

Available values:

  • true - apply caAdjustments on data

  • false - do not apply caAdjustments on data

Response

Parameter
Type
Description

symbol

String

Instrument symbol

open

Decimal

First order book execution price of the interval

close

Decimal

Last order book execution price of the interval

high

Decimal

Highest order book execution price of the interval

low

Decimal

Lowest order book execution price of the interval

volume

Decimal

Total volume of order book execution price of the interval

vwa

Decimal

Volume weighted average price of order book executions of the interval

timeStamp

Int or Unix timestamp

Starting timestamp of the interval

format: if timespan=DAY: yyyyMMdd else epoch time in sec

Error Codes

Code
Message

1

System is unavailable

2

Missing or invalid parameter: [FieldName]

3

Wrong symbol [symbol]

Samples

{
  "q": "v1/exchange.marketdata/candles",
  "token": "eyJleGNoYW5nZUlkIjozMCwicHJvamVjdElkIjoyMDB9",
  "sid": 14,
  "d": {
    "symbol": "AAPL",
    "timespan": "MINUTE",
    "multiplier": 1,
    "from": 1701159900
  }
}
{
  "sid": 14,
  "q": "v1/exchange.marketdata.history/candles",
  "token": "eyJleGNoYW5nZUlkIjozMCwicHJvamVjdElkIjoxMTV9",
  "d": {
    "symbol": "Spot",
    "timespan": "MINUTE",
    "from": 1712970598,
    "to": 1713094027,
    "multiplier": 1
  }
}
{
  "q": "v1/exchange.marketdata/candles",
  "sid": 14,
  "d": {
    "symbol": "TEST2",
    "open": 110.5,
    "close": 100.5,
    "high": 120.5,
    "low": 90.5,
    "volume": 10000,
    "vwa": 100.5,
    "timeStamp": 1709536080000
  }
}
{
  "q": "v1/exchange.marketdata/candles",
  "sid": 16,
  "d": {
    "symbol": "TEST1",
    "open": 10.5,
    "close": 14.5,
    "high": 14.5,
    "low": 10.5,
    "volume": 450,
    "vwa": 11.922222222222222,
    "timeStamp": 20240304
  }
}
{
  "sig": 2,
  "q": "v1/exchange.marketdata/candles",
  "errorType": "500",
  "sid": 13,
  "d": {
    "errorCode": 3,
    "errorMessage": "Wrong symbol 0Test"
  }
}
PreviousAuction Indicative Equilibrium PriceNextGet Settlement Prices

Last updated 1 month ago