Futures
Other Current Futures Methods
value QuoteClient::get_future_real_time_quote_value(value contract_codes)
value QuoteClient::get_future_history_main_contract(value contract_codes, time_t begin_time = -1, time_t end_time = -1)contract_codes is a required JSON string array. The first method returns raw real-time quote JSON. The second queries historical main contracts; times default to -1 and are sent only when positive. Relevant futures quote permission is required.
auto quotes = quote_client.get_future_real_time_quote_value(contract_codes);
auto history = quote_client.get_future_history_main_contract(contract_codes);Response provenance: the raw JSON methods have no fixed SDK model or verified fixture. Historical-main-contract fields follow the server response.
Get Futures Exchanges
value QuoteClient::get_future_exchange(SecType sec_type)
Description
Returns the supported futures exchanges.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| sec_type | SecType | No | Security type, default SecType::FUT |
Return
web::json::value JSON object
Example
#include "tigerapi/quote_client.h"
#include "tigerapi/client_config.h"
using namespace TIGER_API;
ClientConfig config(false, U("your_config_directory_path"));
QuoteClient quote_client(config);
value result = quote_client.get_future_exchange();
ucout << result.serialize() << std::endl;Get Futures Contracts
value QuoteClient::get_future_contracts(utility::string_t type)
Description
Returns the futures contracts for a specified product.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | utility::string_t | Yes | Futures product code, e.g., U("CL") (Crude Oil), U("ES") (S&P 500) |
Return
web::json::value JSON object
Example
ClientConfig config(false, U("your_config_directory_path"));
QuoteClient quote_client(config);
value result = quote_client.get_future_contracts(U("CL"));
ucout << result.serialize() << std::endl;Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{"contractCode": "ES2609", "type": "ES", "name": "E-mini S&P 500", "exchangeCode": "CME", "multiplier": 50.0, "contractMonth": "202609"},
{"contractCode": "ES2612", "type": "ES", "name": "E-mini S&P 500", "exchangeCode": "CME", "multiplier": 50.0, "contractMonth": "202612"}
]
}Get Continuous Futures Contracts
value QuoteClient::get_future_continuous_contracts(utility::string_t type)
Description
Returns continuous-contract information for a specified futures product.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | utility::string_t | Yes | Futures product code |
Return
web::json::value JSON object
Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{"contractCode": "ESmain", "type": "ES", "name": "E-mini S&P 500 (Main)", "exchangeCode": "CME", "multiplier": 50.0}
]
}Get the Current Main Contract
value QuoteClient::get_future_current_contract(utility::string_t type)
Description
Returns the current main contract for a specified futures product.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| type | utility::string_t | Yes | Futures product code |
Return
web::json::value JSON object
Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": {
"contractCode": "ES2609",
"type": "ES",
"name": "E-mini S&P 500",
"exchangeCode": "CME",
"multiplier": 50.0,
"contractMonth": "202609"
}
}Get a Futures Contract by Contract Code
value QuoteClient::get_future_contract_by_contract_code(utility::string_t contract_code)
Description
Returns futures contract information for a specific contract code.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| contract_code | utility::string_t | Yes | Contract code, e.g., U("CL2312") |
Return
web::json::value JSON object
Get Futures Contracts by Exchange
value QuoteClient::get_future_contract_by_exchange_code(utility::string_t exchange_code)
Description
Returns futures contracts for an exchange code.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| exchange_code | utility::string_t | Yes | Exchange code, e.g., U("CME"), U("NYMEX") |
Return
web::json::value JSON object
Get Futures Bars
value QuoteClient::get_future_kline(value contract_codes, utility::string_t period, time_t begin_time, time_t end_time, int limit, utility::string_t page_token)
Description
Returns candlestick bars (K-line data) for futures contracts.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| contract_codes | value | Yes | Contract code array, up to 50 |
| period | BarPeriod or utility::string_t | No | Bar period; default BarPeriod::DAY. Available values: day/week/month/year/1min/3min/5min/10min/15min/30min/45min/60min/2hour/3hours/4hour/6hour |
| begin_time | time_t | No | Start Unix timestamp in milliseconds, default -1 |
| end_time | time_t | No | End Unix timestamp in milliseconds, default -1 |
| limit | int | No | Number of records, default 251 |
| page_token | utility::string_t | No | Pagination token |
Return
A web::json::value JSON object or a vector<Kline> list of bar objects.
Example
ClientConfig config(false, U("your_config_directory_path"));
QuoteClient quote_client(config);
value codes = value::array();
codes[0] = value::string(U("CL2312"));
value result = quote_client.get_future_kline(codes, U("day"));
ucout << result.serialize() << std::endl;Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{
"contractCode": "ES2612",
"period": "day",
"items": [
{"time": 1785355200000, "open": 7600.0, "high": 7640.0, "low": 7580.0, "close": 7625.0, "volume": 125000},
{"time": 1785441600000, "open": 7625.0, "high": 7650.0, "low": 7610.0, "close": 7640.0, "volume": 98000}
]
}
]
}Get Real-Time Futures Quotes
vector<RealtimeQuote> QuoteClient::get_future_real_time_quote(value contract_codes)Description
Returns real-time quotes for futures contracts.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| contract_codes | value | Yes | Contract code array, up to 50 |
Return
vector<RealtimeQuote> Real-time quote object list
RealtimeQuote Object Properties (Futures Additional Fields)
| Property | Type | Description |
|---|---|---|
| contract_code | utility::string_t | Contract code |
| open_interest | long long | Open interest |
| limit_down | int | Limit down price |
| limit_up | int | Limit up price |
Example
ClientConfig config(false, U("your_config_directory_path"));
QuoteClient quote_client(config);
value codes = value::array();
codes[0] = value::string(U("CL2312"));
vector<RealtimeQuote> quotes = quote_client.get_future_real_time_quote(codes);
for (auto& q : quotes) {
ucout << q.contract_code << U(" price: ") << q.latest_price << std::endl;
}Get Futures Trade Ticks
value QuoteClient::get_future_tick(utility::string_t contract_code, long begin_index, long end_index, int limit)
Description
Returns tick-by-tick trades for futures contracts.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| contract_code | utility::string_t | Yes | Contract code |
| begin_index | long | No | Start index, default 0 |
| end_index | long | No | End index, default 100 |
| limit | int | No | Number of records, default 1000 |
Return
web::json::value JSON object
Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{
"contractCode": "ES2612",
"items": [
{"time": 1785527980000, "price": 7625.0, "volume": 12, "type": "+"},
{"time": 1785527980100, "price": 7624.75, "volume": 5, "type": "-"}
]
}
]
}Get a Futures Trading Date
value QuoteClient::get_future_trading_date(utility::string_t contract_code, utility::string_t trading_date)
Description
Returns trading-date information for a futures contract.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| contract_code | utility::string_t | Yes | Contract code |
| trading_date | utility::string_t | Yes | Trading date |
Return
web::json::value JSON object
Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{"date": "2025-07-28", "type": "TRADING"},
{"date": "2025-07-29", "type": "TRADING"}
]
}Get Futures Market Depth
value QuoteClient::get_future_depth(value contract_codes, utility::string_t lang)
Description
Returns market depth for futures contracts.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| contract_codes | value | Yes | Contract code array, up to 50 |
| lang | utility::string_t | No | Language, default empty |
Return
web::json::value JSON object
Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{
"contractCode": "ES2612",
"asks": [
{"price": 7623.50, "volume": 120},
{"price": 7624.00, "volume": 85}
],
"bids": [
{"price": 7622.25, "volume": 95},
{"price": 7622.00, "volume": 150}
]
}
]
}Updated 7 days ago
