Funds

get_fund_symbols Get Fund Symbol List

value QuoteClient::get_fund_symbols()

Description

Get the list of all fund symbol codes

Parameters

None

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("/path/to/your/properties/"));
QuoteClient quote_client(config);

value result = quote_client.get_fund_symbols();
ucout << result.serialize() << std::endl;

Return Example

[
        "IE00B11XZ988.USD",
        "IE00B7SZLL34.SGD",
        "LU0790902711.USD",
        "LU0476943708.HKD",
        "LU0098860793.USD",
        "SG9999014039.USD"
]

get_fund_contracts Get Fund Contract Information

value QuoteClient::get_fund_contracts(const value &symbols)

Description

Batch get fund contract information

Parameters

ParameterTypeRequiredDescription
symbolsvalueYesFund symbol code array, e.g., value::array({value::string(U("IE00B11XZ988.USD"))})

Return

web::json::value JSON object

Data item fields:

NameExampleDescription
symbolIE00B464Q616.USDFund symbol code, suffix is 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
tradeabletrueWhether tradeable
sub_typeFixed IncomeSub type
dividend_typeINCDividend type
tiger_vaultfalseWhether Tiger Vault fund

Example

#include "tigerapi/quote_client.h"
#include "tigerapi/client_config.h"

using namespace TIGER_API;

ClientConfig config(false, U("/path/to/your/properties/"));
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;

get_fund_quote Get Fund Latest Quote

value QuoteClient::get_fund_quote(const value &symbols)

Description

Get the latest fund quotes

Parameters

ParameterTypeRequiredDescription
symbolsvalueYesFund symbol code array, max 500

Return

web::json::value JSON object

FieldTypeDescription
symbolstringSymbol code
closefloatClose price
timestampintMillisecond timestamp

Example

#include "tigerapi/quote_client.h"
#include "tigerapi/client_config.h"

using namespace TIGER_API;

ClientConfig config(false, U("/path/to/your/properties/"));
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;

Return Example

             symbol  close      timestamp
0  IE00B11XZ988.USD  25.10  1691596800000
1  LU0476943708.HKD   5.22  1691596800000

get_fund_history_quote Get Fund Historical Quote

value QuoteClient::get_fund_history_quote(const value &symbols, time_t begin_time, time_t end_time, int limit)

Description

Get fund historical quotes

Parameters

ParameterTypeRequiredDescription
symbolsvalueYesFund symbol code array, max 500
begin_timetime_tYesStart timestamp, unit: milliseconds (ms)
end_timetime_tYesEnd timestamp, unit: milliseconds (ms)
limitintNoNumber of records per symbol to return

Return

web::json::value JSON object

FieldTypeDescription
symbolstringSymbol code
navfloatNet asset value
timeintTimestamp

Example

#include "tigerapi/quote_client.h"
#include "tigerapi/client_config.h"

using namespace TIGER_API;

ClientConfig config(false, U("/path/to/your/properties/"));
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;

Return Example

               symbol           time   nav
0    LU0476943708.HKD  1691596800000  5.22
1    LU0476943708.HKD  1691510400000  5.22
2    LU0476943708.HKD  1691424000000  5.20
3    LU0476943708.HKD  1691337600000  5.25