Differences
This shows you the differences between two versions of the page.
Both sides previous revision Previous revision Next revision | Previous revision | ||
api:chart [2024/01/09 17:37] – [Non-Aggregated Chart Data (Trade History)] chad | api:chart [2025/03/14 02:48] (current) – removed chad | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== T4 Chart API ====== | ||
- | |||
- | Our chart API provides data in aggregated or non-aggregated (raw trade) formats. | ||
- | |||
- | < | ||
- | All times are in CST. | ||
- | </ | ||
- | |||
- | ===== Aggregated Chart Data ===== | ||
- | |||
- | ==== Overview ==== | ||
- | The **GetBarChart** API retrieves bar chart data for a specified trading instrument over a given date range. This API supports various chart types and bar intervals, tailored for detailed data analysis in financial contexts. | ||
- | |||
- | ==== API Endpoint ==== | ||
- | < | ||
- | |||
- | ==== Headers ==== | ||
- | |||
- | For proper access and response handling, the **GetBarChart** API requires certain HTTP headers to be set in the request. | ||
- | |||
- | ^ Header | ||
- | | Authorization | ||
- | | Accept | ||
- | |||
- | **Examples: | ||
- | |||
- | * To authorize the request, include the bearer token: | ||
- | < | ||
- | |||
- | * To receive the response in a compact binary format, set the `Accept` header accordingly: | ||
- | < | ||
- | or | ||
- | < | ||
- | |||
- | Setting the `Accept` header is optional, and if it is not included, the API will return the response in a JSON format. | ||
- | |||
- | ==== Parameters ==== | ||
- | ^ Parameter | ||
- | | **exchangeId** | ||
- | | **contractId** | ||
- | | **chartType** | ||
- | | **barInterval** | ||
- | | **barPeriod** | ||
- | | **tradeDateStart** | ||
- | | **tradeDateEnd** | ||
- | | marketID | ||
- | | continuationType | Method of continuation for the chart. Only **Volume** is currently supported. | ||
- | | resetInterval | ||
- | | contractMonths | ||
- | | rolloverThreshold| Rollover threshold (not applicable when **ContinuationType.Volume** is used). | ||
- | | forwardMonths | ||
- | |||
- | ==== Response ==== | ||
- | |||
- | The response from the **GetBarChart** API is a JSON object containing detailed information about the bar chart data. Below is the structure of the response along with a description of each element: | ||
- | |||
- | === Bars === | ||
- | ^ Element | ||
- | | tradeDate | ||
- | | time | Time when the bar data starts. | ||
- | | closeTime | ||
- | | marketID | ||
- | | openPrice | ||
- | | highPrice | ||
- | | lowPrice | ||
- | | closePrice | ||
- | | volume | ||
- | | volumeAtBid | ||
- | | volumeAtOffer | ||
- | | trades | ||
- | | tradesAtBid | ||
- | | tradesAtOffer | ||
- | |||
- | === MarketDefinitions === | ||
- | ^ Element | ||
- | | marketID | ||
- | | minPriceIncrement | Minimum increment of the market' | ||
- | | priceCode | ||
- | | tickValue | ||
- | | vpt | Additional market-specific information (variable). | ||
- | |||
- | === ModeChanges === | ||
- | ^ Element | ||
- | | marketID | ||
- | | tradeDate | ||
- | | time | Time when the mode change occurred. | ||
- | | marketMode | ||
- | |||
- | === OpenInterests === | ||
- | ^ Element | ||
- | | marketID | ||
- | | tradeDate | ||
- | | time | Time of the recorded open interest. | ||
- | | openInterest | ||
- | |||
- | === Settlements === | ||
- | ^ Element | ||
- | | marketID | ||
- | | tradeDate | ||
- | | time | Time when the settlement information was recorded. | ||
- | | settlementPrice | ||
- | | isHeld | ||
- | |||
- | ==== Example JSON Response ==== | ||
- | |||
- | < | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | ], | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | ], | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | // ... additional mode changes ... | ||
- | ], | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | // ... additional open interests ... | ||
- | ], | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | } | ||
- | // ... additional settlements ... | ||
- | ] | ||
- | } | ||
- | </ | ||
- | |||
- | |||
- | |||
- | |||
- | |||
- | ===== Non-Aggregated Chart Data (Trade History) ===== | ||
- | |||
- | ====== GetTradeHistory API Documentation ====== | ||
- | |||
- | ==== Overview ==== | ||
- | The **GetTradeHistory** API retrieves historical trade data for a specified trading instrument within a given date and time range. This API allows for querying trade data based on the trade date or specific start and end timestamps. | ||
- | |||
- | ==== API Endpoint ==== | ||
- | < | ||
- | |||
- | ==== Headers ==== | ||
- | ^ Header | ||
- | | Authorization | Bearer < | ||
- | | Accept | ||
- | |||
- | ==== Parameters ==== | ||
- | ^ Parameter | ||
- | | exchangeId | ||
- | | contractId | ||
- | | marketID | ||
- | | tradeDateStart | ||
- | | tradeDateEnd | ||
- | | start | The calendar start date and time for the request in CST (optional). | ||
- | | end | The calendar end date and time for the request in CST (optional). | ||
- | | since | Filters data to only include trades after the specified date and time (optional). | ||
- | |||
- | **Note:** Pass either **tradeDateStart** and **tradeDateEnd** OR **start** and **end**. Including both will result in an error. Use **since** to further filter data to only include trades after the specified date and time. | ||
- | |||
- | ==== Response Structure ==== | ||
- | ^ Element | ||
- | | exchangeID | ||
- | | contractID | ||
- | | marketID | ||
- | | requestStatusMessage| Any status messages or errors related to the request. | ||
- | | tradeDateStart | ||
- | | tradeDateEnd | ||
- | | trades | ||
- | | marketDefinitions | ||
- | | modeChanges | ||
- | | openInterests | ||
- | | settlements | ||
- | | vwaPs | An array detailing volume-weighted average prices (VWAP). | ||
- | |||
- | ^ Element | ||
- | | marketID | ||
- | | tradeDate | ||
- | | time | The specific time when the trade occurred. | ||
- | | tradePrice | ||
- | | aggressorSide | ||
- | |||
- | ^ Element | ||
- | | marketID | ||
- | | tradeDate | ||
- | | time | The specific time when the VWAP is calculated. | ||
- | | vwapPrice | ||
- | |||
- | |||
- | ==== Example JSON Response ==== | ||
- | |||
- | < | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | { | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | " | ||
- | }, | ||
- | ... | ||
- | ], | ||
- | " | ||
- | " | ||
- | ... | ||
- | ], | ||
- | " | ||
- | ... | ||
- | ], | ||
- | " | ||
- | ... | ||
- | ], | ||
- | " | ||
- | ... | ||
- | ] | ||
- | } | ||
- | </ | ||
- | |||
- | The response is structured as a JSON object with various elements containing detailed trade data and related information for the specified contract and exchange within the requested time frame. | ||