api:chart

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
api:chart [2024/01/09 16:24] chadapi: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. 
- 
-<bootnote critical> 
-All times are in CST. 
-</note> 
- 
-===== 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 ==== 
-<code>GET https://api-sim.t4login.com/chart/barchart</code> 
- 
-==== Parameters ==== 
-^ Parameter        ^ Description                                                                                       ^ 
-| **exchangeId**       | **Required**. Identifier for the exchange.                                                        | 
-| **contractId**       | **Required**. Identifier for the contract.                                                        | 
-| **chartType**        | **Required**. Type of chart to compute. Currently, only **Bar** type is supported.              | 
-| **barInterval**      | **Required**. Interval at which bars are aggregated. Possible values:\\ • **Tick**: Bars aggregated based on trade count.\\ • **TickRange**: Bars aggregated based on price range.\\ • **Volume**: Bars aggregated based on number of contracts traded.\\ • **Second**: Bars aggregated into multiples of seconds.\\ • **Minute**: Bars aggregated into multiples of minutes.\\ • **Hour**: Bars aggregated into multiples of hours.\\ • **Day**: Bars aggregated into multiples of days.\\ • **Week**: Bars aggregated into multiples of weeks. | 
-| **barPeriod**        | **Required**. Period for the bars.                                                                | 
-| **tradeDateStart**   | **Required**. Start date for the trade data.                                                      | 
-| **tradeDateEnd**     | **Required**. End date for the trade data.                                                        | 
-| marketID         | Market ID (optional). Can be omitted when using ContinuationType.                                 | 
-| continuationType | Method of continuation for the chart. Only **Volume** is currently supported.                      | 
-| resetInterval    | Interval at which bar computations reset (not applicable when ContinuationType.Volume is used). \\ Defaults to **TradingDay**. Other possible values:\\ • **None**: No reset interval.\\ • **TradingWeek**: Reset on the trading week boundary.\\ • **ExpiryChange**: Reset on an expiry change. | 
-| contractMonths   | Contract months to include (not applicable when **ContinuationType.Volume** is used).             | 
-| rolloverThreshold| Rollover threshold (not applicable when **ContinuationType.Volume** is used).                      | 
-| forwardMonths    | Forward months (not applicable when **ContinuationType.Volume** is used).                         | 
- 
-==== 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         ^ Description                                      ^ 
-| tradeDate       | Date of the trade.                               | 
-| time            | Time when the bar data starts.                   | 
-| closeTime       | Time when the bar data ends.                     | 
-| marketID        | Identifier for the market.                       | 
-| openPrice       | Opening price for this bar.                      | 
-| highPrice       | Highest price in this bar.                       | 
-| lowPrice        | Lowest price in this bar.                        | 
-| closePrice      | Closing price for this bar.                      | 
-| volume          | Total volume of trades in this bar.              | 
-| volumeAtBid     | Volume of trades at the bid price.               | 
-| volumeAtOffer   | Volume of trades at the offer price.             | 
-| trades          | Total number of trades in this bar.              | 
-| tradesAtBid     | Number of trades at the bid price.               | 
-| tradesAtOffer   | Number of trades at the offer price.             | 
- 
-=== MarketDefinitions === 
-^ Element           ^ Description                                              ^ 
-| marketID          | Identifier for the market.                               | 
-| minPriceIncrement | Minimum increment of the market's price.                 | 
-| priceCode         | Code related to the pricing of the market.               | 
-| tickValue         | Value of each tick in the market's pricing.              | 
-| vpt               | Additional market-specific information (variable).       | 
- 
-=== ModeChanges === 
-^ Element         ^ Description                                ^ 
-| marketID        | Identifier for the market.                 | 
-| tradeDate       | Date of the trade.                         | 
-| time            | Time when the mode change occurred.        | 
-| marketMode      | The mode of the market at the given time.  | 
- 
-=== OpenInterests === 
-^ Element         ^ Description                                ^ 
-| marketID        | Identifier for the market.                 | 
-| tradeDate       | Date of the trade.                         | 
-| time            | Time of the recorded open interest.        | 
-| openInterest    | The amount of open interest.               | 
- 
-=== Settlements === 
-^ Element           ^ Description                                           ^ 
-| marketID          | Identifier for the market.                            | 
-| tradeDate         | Date of the trade.                                    | 
-| time              | Time when the settlement information was recorded.    | 
-| settlementPrice   | Price at which the trade was settled.                 | 
-| isHeld            | Indicates if the settlement was held (boolean).       | 
- 
-==== Example JSON Response ==== 
- 
-<code> 
-{ 
-    "tradeDateStart": "2024-01-08T00:00:00", 
-    "tradeDateEnd": "2024-01-08T00:00:00", 
-    "activeMarket": "XCME_Eq ES (H24)", 
-    "bars": [ 
-        { 
-            "tradeDate": "2024-01-08T00:00:00", 
-            "time": "2024-01-08T00:00:00", 
-            "closeTime": "2024-01-08T15:59:59.5853624", 
-            "marketID": "XCME_Eq ES (H24)", 
-            "openPrice": "473575", 
-            "highPrice": "480325", 
-            "lowPrice": "471525", 
-            "closePrice": "479800", 
-            "volume": 1339989, 
-            "volumeAtBid": 665050, 
-            "volumeAtOffer": 674939, 
-            "trades": 320624, 
-            "tradesAtBid": 152333, 
-            "tradesAtOffer": 168291 
-        } 
-    ], 
-    "marketDefinitions": [ 
-        { 
-            "marketID": "XCME_Eq ES (H24)", 
-            "minPriceIncrement": "25", 
-            "priceCode": "", 
-            "tickValue": 12.5, 
-            "vpt": "" 
-        } 
-    ], 
-    "modeChanges": [ 
-        { 
-            "marketID": "XCME_Eq ES (H24)", 
-            "tradeDate": "2024-01-08T00:00:00", 
-            "time": "2024-01-07T08:04:27.7736882", 
-            "marketMode": 5 
-        }, 
-        // ... additional mode changes ... 
-    ], 
-    "openInterests": [ 
-        { 
-            "marketID": "XCME_Eq ES (H24)", 
-            "tradeDate": "2024-01-08T00:00:00", 
-            "time": "2024-01-07T12:43:16.8256856", 
-            "openInterest": 2211632 
-        }, 
-        // ... additional open interests ... 
-    ], 
-    "settlements": [ 
-        { 
-            "marketID": "XCME_Eq ES (H24)", 
-            "tradeDate": "2024-01-08T00:00:00", 
-            "time": "2024-01-05T16:38:39.9345143", 
-            "settlementPrice": "473475" 
-        }, 
-        { 
-            "marketID": "XCME_Eq ES (H24)", 
-            "tradeDate": "2024-01-08T00:00:00", 
-            "time": "2024-01-08T15:01:01.4810068", 
-            "isHeld": true 
-        } 
-        // ... additional settlements ... 
-    ] 
-} 
-</code> 
- 
- 
- 
- 
- 
-===== Un-Aggregated Chart Data (Trade History) ===== 
  
  • api/chart.1704817482.txt.gz
  • Last modified: 2024/01/09 16:24
  • by chad