Point In Time TCA API

Methodology

 

One of the most common use cases for market history is transaction cost analysis (TCA) also known as best execution (BestEx). The purpose behind TCA analysis is to measure performance of executed trades (orders and/or fills). TCA leverages various market prices and computed analytics otherwise known as benchmarks for this performance measurement. The comparison of orders to benchmarks provides a means to measure the efficacy of a trader, algorithm or venue.

Benchmarks consist of interval, point-in-time and end of the day pricing data. A key characteristic of TCA analysis is benchmarks are most often unique to the individual order (i.e. traded instrument of the order) based on its arrival and ending timestamps (i.e. the interval). To that end, this OTC query API is optimally designed for this case. The API includes four functions (queries):

  1. Point-In-Time
  2. Interval

Each function takes a structured input consisting of multiple instruments (the Security ID) where each one has a set of attributes, most notably the date/time unique to the instrument. This input structure can be provided in batch (i.e. multiple securities each with their own unique set of attributes) up to 32k in total length. See the section Common API Input for details.

Common API Input Structure

 The input to each API is a fixed-field/delimited structure; optional fields would be empty (null) values. The input has a field delimiter (a tilde ~) and a row delimiter (pipe |), the general format is as follows:

|SecurityID~SymbologyName~MICs~QueryID~StartDatetime~EndDatetime|…

We can classify the 7 fields as follows:

Field

Description

SecurityID

The Instrument identifier

Symbology

Symbology of the SecurityID, see below for the list of supported symbologies

MICs

Exchange MICs for this SecurityID – this identifies the respective market and what exchanges to include for the consolidated markets Also supports the pre-defined keyword – {ALL} to indicate all Exchange MICs of the market (or market consolidation, e.g. “XNYS.{ALL}” for NYSE and all participating exchange on the CTA/UTP (SIP) feed

QueryID

A user-supplied identifier for this query invocation

Target Currency

This is the ‘target’ currency for all resulting prices. This is generally specific to the European Consolidation (a consolidation of 34 exchanges and MTFs in the EU), where it is desirable to include prices normalized to the target currency – as an example, currency=GBP would means all trades in EUR would be converted to GBP using the FX rate relevant to the time of the request (see StartDateTime below). Besides a rate conversion, this normalization also covers unit conversions (e.g. GBX to GBP) for LSE, JSE (Johannesburg), Tel Aviv markets

Symbol Date

This is the target date for this requested SecurityID for any/all corporate actions – price splits and name changes. Normally, it would be the StartDateTime but any date (YYYYMMDD) is acceptable to indicate a date when ‘this’ SecurityID was active

StartDatetime

Date (or date & time), ISO 8601 format: e.g. YYYY-mm-DDTHH:MM:SS.qqqqqq+/-HHMM see https://en.wikipedia.org/wiki/ISO_8601 Note the time resolution is to the microsecond.

EndDatetime

Date (or date & time), ISO 8601 format: e.g. 2018-09-05T11:01:33.000000+/-0000 see https://en.wikipedia.org/wiki/ISO_8601

Here are a few examples:

|AAPL US~BTKR~XNAS.{ALL}~Q1234~USD~20190807~2019-08-07T14:33:00.000000+0000~2019-08-07T15:55:00.000000+0000~

|MSFT~OTKR~XNAS~Q1234~USD~20190815~2019-08-15T11:35:00.000000+0000~2019-08-15T11:35:39.000000+0000~

|VOD LN~BTKR~XLON.{ALL}~Q1234~GBP~20190107~2020-01-07T10:10:10.000000+0000~2020-01-07T12:30:54.590000-0000~

|AUTO LN~BTKR~XLON.{ALL}~Q1234~GBP~20190107~2020-01-07T13:13:00.000000+0000~2020-01-07T13:50:54.590000-0000~

|CPG LN~BTKR~XLON.{ALL}~Q1234~GBP~20190107~2020-01-07T11:43:34.000000+0000~2020-01-07T15:30:54.590000-0000~

|000001~OTKR~XSHE.{ALL}~Q1234~CNY~20200603~2020-06-03T10:30:00.000000+0000~2020-06-03T12:30:54.590000-0000~

|AKSO NO~BTKR~XOSL.{ALL}~Q1234~NOK~20200330~2020-03-30T11:43:34.000000+0000~2020-03-30T15:43:34.000000+0000~

|RYA LN~BTKR~XLON.{ALL}~Q1234~GBP~20200330~2020-03-30T11:43:34.000000+0000~2020-03-30T15:43:34.000000+0000~

|RDSA NA~BTKR~XAMS.{ALL}~Q1234~GBP~20200330~2020-03-30T11:43:34.000000+0000~2020-03-30T15:43:34.000000+0000~

|ANH SJ~BTKR~XJSE.{ALL}~Q1234~ZAR~20200330~2020-03-30T11:43:34.000000+0000~2020-03-30T15:43:34.000000+0000~

|NICE IT~BTKR~XTAE.{ALL}~Q1234~ILS~20200330~2020-03-30T11:43:34.000000+0000~2020-03-30T12:43:34.000000+0000~

|POLI IT~BTKR~XTAE.{ALL}~Q1234~ILS~20200330~2020-03-30T11:43:34.000000+0000~2020-03-30T15:43:34.000000+0000~

|GSK LN~BTKR~XLON.{ALL}~Q1234~GBP~20200330~2020-03-30T11:43:34.000000+0000~2020-03-30T14:43:34.000000+0000~

Query API Definitions

Point-In-Time Query

The Point-In-Time (PIT) query is designed to provide tick prices for a specific timestamp. A date and time to microsecond resolution where a series of market prices are provided. See Output section.

Input:

The input structure requires the StartDateTime (no EndDateTime is required or used).

|VOD LN~BTKR~XLON.{ALL}~Q1234~GBP~20190107~2019-01-07T10:10:10.000000+0000~

Output:

The returned result is a normalized schema for all supported global Equity markets. Price data will be at or near the indicated time on the specified date. All inputs are echoed back in the results.

  • Bid/Ask quote and mid and spread price, only regular quotes within market-open time ranges are eligible. If the requested time is pre-market the selected quote will be after the opening trade. If the requested quote is post-market the selected quote will the last quote prior to the closing print
  • Bid & Ask Prices +/- 1 second and 5 second from the input date’s timestamp (PIT)
  • Last trade (tick) price relative to the input date’s timestamp (PIT)
  • Next trade (tick) price nearest to the input date’s timestamp (PIT)
  • Trade prices (forward mark-outs) at 5 minute, 15 minute and 30 minutes from the input date’s timestamp. These will be to the nearest time mark relative to the security’s input timestamp.
  • All prices are normalized to the indicated target currency
  • Market-specific sale and quote conditions of the respective market/exchange

Eligible trade and quote prices are based sale conditions (trade types) – only regular trades between the opening and closing prints are included in any returned tick prices and computed values.

Interval Query

The Interval Query is designed to provide market prices within the specified interval – the starting and ending date and time.

Input:

The input structure requires the StartDateTime and EndDateTime, both are mandatory input fields.

|VOD LN~BTKR~XLON.{ALL}~Q1234~GBP~20190107~2019-01-07T10:10:10.000000+0000~2019-01-07T10:13:10.000000+0000~

Output:

The returned price data will be within the time interval on the specified dates.

  • Average (quote) spread for the interval, only regular quotes within market-open time ranges are eligible. If the requested time is pre-market the selected quote will be after the opening trade. If the requested quote is post-market the selected quote will the last quote prior to the closing print
  • Interval traded volume & trade count
  • Interval trade price volatility, note: the interval volatility is computed as on returns of 1min VWAP – for a minimum population sample as a defined set time interval ($VOL_SETSIZE)
  • Interval VWAP
  • Interval TWAP
  • Interval OHLC

Eligible trade and quote prices are based sale conditions (trade types) – only regular trades between the opening and closing prints are included in any returned tick prices and computed values.

Supported Markets, Countries, Time zones and Symbologies for Input

The input structure includes at least one MIC code of the requested SecurityID. This MIC is mapped to the respective market in the respective geography. The mapping also includes country, timezone, market open/close hours, trade conditions, auction phases, and currency.   This implies the StartDateTime and EndDataTime are required to be in the local timezone of the MIC. In total, there are 85 global markets supported by this API.

Supported symbologies include:

Symbology Name for the input structure’s ~Symbology~ field

Description

ISN

ISIN

SED

SEDOL

FGC

(FIGI Composite) e.g. IBM US

FGV

(FIGI Venue) e.g. IBM NY

BTKR

Bloomberg

CUS

CUSIP

OTKR

OneTick Ticker (our own name)

Are you ready to outsmart your competition?

Empower your quantitative research and trading with OneTick's precision data & analytics today!

Request Demo