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:01] – [Un-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 un-aggregated 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) ===== | ||