Fund
C++ HTTP methods return the value of the complete response's
datafield. The outercode,message, andtimestampfields, and thedatafield name itself, are not part of the returnedvalue.
Get Fund Symbols
value QuoteClient::get_fund_symbols(utility::string_t lang = U(""))
Description
Returns all fund symbols.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| lang | utility::string_t | No | Response language; SDK default is an empty string, which is omitted from the request |
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_fund_symbols();
ucout << result.serialize() << std::endl;Get Fund Contracts
value QuoteClient::get_fund_contracts(const value &symbols, utility::string_t lang = U(""))
Description
Returns contract information for multiple funds.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | value | Yes | Array of up to 500 fund symbols, for example value::array({value::string(U("IE00B11XZ988.USD"))}) |
| lang | utility::string_t | No | Response language; SDK default is an empty string, which is omitted from the request |
Return
web::json::value JSON object
Data item fields:
| Name | Example | Description |
|---|---|---|
| symbol | IE00B464Q616.USD | Fund symbol; the suffix identifies the currency |
| name | ASIA STRATEGIC INTEREST BOND FUND "E" (USD) INC MONTHLY | Fund name |
| company_name | PIMCO Global Advisors (Ireland) Limited | Fund company name |
| market | US | Market: US/HK/CN |
| sec_type | FUND | Security type |
| currency | USD | USD/HKD/CNH |
| tradeable | true | Indicates whether the fund is tradable |
| sub_type | Fixed Income | Sub type |
| dividend_type | INC | Dividend type |
| tiger_vault | false | Indicates whether the fund is a Tiger Vault fund |
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 symbols = value::array();
symbols[0] = value::string(U("IE00B11XZ988.USD"));
value result = quote_client.get_fund_contracts(symbols);
ucout << result.serialize() << std::endl;Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{"symbol": "SPY", "name": "SPDR S&P 500 ETF", "secType": "FUND", "market": "US", "currency": "USD"},
{"symbol": "QQQ", "name": "Invesco QQQ Trust", "secType": "FUND", "market": "US", "currency": "USD"}
]
}Get Latest Fund Quotes
value QuoteClient::get_fund_quote(const value &symbols, utility::string_t lang = U(""))
Description
Returns the latest fund quotes.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | value | Yes | Array of up to 500 fund symbols |
| lang | utility::string_t | No | Response language; SDK default is an empty string, which is omitted from the request |
Return
web::json::value JSON object
| Field | Type | Description |
|---|---|---|
| symbol | string | Fund symbol |
| close | float | Close price |
| timestamp | int | Millisecond timestamp |
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 symbols = value::array();
symbols[0] = value::string(U("IE00B11XZ988.USD"));
symbols[1] = value::string(U("LU0476943708.HKD"));
value result = quote_client.get_fund_quote(symbols);
ucout << result.serialize() << std::endl;Response Example
{
"code": 0,
"message": "success",
"timestamp": 1785528000000,
"data": [
{
"symbol": "SPY",
"open": 545.20,
"high": 548.90,
"low": 543.10,
"close": 547.85,
"preClose": 544.30,
"latestPrice": 547.85,
"volume": 52345000
}
]
}Get Historical Fund Quotes
value QuoteClient::get_fund_history_quote(
const value &symbols, time_t begin_time = -1, time_t end_time = -1,
int limit = 200, utility::string_t lang = U(""))Description
Returns historical fund quotes.
Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
| symbols | value | Yes | Array of up to 500 fund symbols |
| begin_time | time_t | No | Start Unix timestamp in milliseconds; this SDK uses time_t to carry the millisecond value. Default -1, sent only when positive |
| end_time | time_t | No | End Unix timestamp in milliseconds; this SDK uses time_t to carry the millisecond value. Default -1, sent only when positive |
| limit | int | No | SDK default 200, sent only when positive |
| lang | utility::string_t | No | Response language; SDK default is an empty string, which is omitted from the request |
Return
web::json::value JSON object
| Field | Type | Description |
|---|---|---|
| symbol | string | Fund symbol |
| nav | float | Net asset value |
| time | int | Timestamp |
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 symbols = value::array();
symbols[0] = value::string(U("LU0476943708.HKD"));
value result = quote_client.get_fund_history_quote(symbols, 1691337600000, 1691596800000);
ucout << result.serialize() << std::endl;Updated 4 days ago
