Fund

C++ HTTP methods return the value of the complete response's data field. The outer code, message, and timestamp fields, and the data field name itself, are not part of the returned value.

Get Fund Symbols

value QuoteClient::get_fund_symbols(utility::string_t lang = U(""))

Description

Returns all fund symbols.

Parameters

ParameterTypeRequiredDescription
langutility::string_tNoResponse 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

ParameterTypeRequiredDescription
symbolsvalueYesArray of up to 500 fund symbols, for example value::array({value::string(U("IE00B11XZ988.USD"))})
langutility::string_tNoResponse language; SDK default is an empty string, which is omitted from the request

Return

web::json::value JSON object

Data item fields:

NameExampleDescription
symbolIE00B464Q616.USDFund symbol; the suffix identifies the currency
nameASIA STRATEGIC INTEREST BOND FUND "E" (USD) INC MONTHLYFund name
company_namePIMCO Global Advisors (Ireland) LimitedFund company name
marketUSMarket: US/HK/CN
sec_typeFUNDSecurity type
currencyUSDUSD/HKD/CNH
tradeabletrueIndicates whether the fund is tradable
sub_typeFixed IncomeSub type
dividend_typeINCDividend type
tiger_vaultfalseIndicates 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

ParameterTypeRequiredDescription
symbolsvalueYesArray of up to 500 fund symbols
langutility::string_tNoResponse language; SDK default is an empty string, which is omitted from the request

Return

web::json::value JSON object

FieldTypeDescription
symbolstringFund symbol
closefloatClose price
timestampintMillisecond 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

ParameterTypeRequiredDescription
symbolsvalueYesArray of up to 500 fund symbols
begin_timetime_tNoStart Unix timestamp in milliseconds; this SDK uses time_t to carry the millisecond value. Default -1, sent only when positive
end_timetime_tNoEnd Unix timestamp in milliseconds; this SDK uses time_t to carry the millisecond value. Default -1, sent only when positive
limitintNoSDK default 200, sent only when positive
langutility::string_tNoResponse language; SDK default is an empty string, which is omitted from the request

Return

web::json::value JSON object

FieldTypeDescription
symbolstringFund symbol
navfloatNet asset value
timeintTimestamp

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;

Did this page help you?