基金

大约 3 分钟

获取基金代码列表

对应的请求类:FundSymbolRequest

说明

获取所有基金代码列表

参数

参数类型是否必填描述

返回

com.tigerbrokers.stock.openapi.client.https.response.fund.FundSymbolResponsesourceopen in new window

具体结构如下

public class FundSymbolResponse extends TigerResponse {
  @JSONField(name = "data")
  private List<String> symbols;
}

返回数据可以通过FundSymbolResponse.getSymbols()方法调用,结果为包含返回基金代码数据的List

示例

TigerHttpClient client = TigerHttpClient.getInstance().clientConfig(
      ClientConfig.DEFAULT_CONFIG);
FundSymbolResponse response = client.execute(FundSymbolRequest.newRequest());
if (response.isSuccess()) {
  ApiLogger.info(JSONObject.toJSONString(response));
} else {
  ApiLogger.info("response error:" + response.getMessage());
}

返回示例

{
    "code":0,
    "data":[
        "IE00B11XZ988.USD",
        "IE00B7SZLL34.SGD",
        "LU0790902711.USD",
        "LU0476943708.HKD",
        "LU0098860793.USD",
        "SG9999014039.USD"
        // ....
    ],
    "message":"success",
    "sign":"zCIL+uNR083O4FoEUYKudVcstKCzMlZQD2WxRLhjf7pj2qaxhGCaJUtFY95zsmvK0kEI7YL/MyyTMsQU8dfd4/oF9FdDQdWWZRQxAiyJe8+aQuBdRg+BxN8xOl3TahTx2pPklyAxQIMKRJBU3ZgY9OPb040kucXTWgNyP8O643w=",
    "success":true,
    "timestamp":1690858442132
}

获取基金合约信息

对应的请求类:FundContractsRequest

说明 批量获取基金的合约信息

输入参数

com.tigerbrokers.stock.openapi.client.https.request.fund.FundContractsRequest

参数类型是否必填描述
symbolsList<String>Yes基金代码列表 如:"IE00B11XZ988.USD" / "LU0790902711.USD"
langstringNo语言支持: zh_CN,zh_TW,en_US, 默认: en_US

返回

com.tigerbrokers.stock.openapi.client.https.response.fund.FundContractsResponse

其中数据项字段如下 com.tigerbrokers.stock.openapi.client.https.domain.fund.item.FundContractItem

名称示例说明
symbolIE00B464Q616.USD基金代码,后缀为货币
nameASIA STRATEGIC INTEREST BOND FUND "E" (USD) INC MONTHLY基金名称
companyNamePIMCO Global Advisors (Ireland) Limited基金名称
marketUS市场 /US/HK/CN
secTypeFUND合约类别
currencyUSDUSD/HKD/CNH
tradeabletrue是否可交易
subTypeFixed Income子类别
dividendTypeINC分红类型
tigerVaultfalse是否为老虎钱袋子

示例

List<String> symbols = new ArrayList<>();
symbols.add("IE00B11XZ988.USD");
symbols.add("LU0476943708.HKD");
FundContractsRequest request = FundContractsRequest.newRequest(symbols, Language.zh_CN);
FundContractsResponse response = client.execute(request);
if (response.isSuccess()) {
  System.out.println(JSONObject.toJSONString(response));
} else {
  System.out.println("response error:" + response.getMessage());
}

返回示例

{
    "code":0,
    "data":[
        {
            "companyName":"太平洋全球顾问(爱尔兰)有限公司",
            "currency":"USD",
            "dividendType":"ACC",
            "market":"MF",
            "name":"PIMCO总回报债券基金 E Acc",
            "secType":"FUND",
            "subType":"Fixed Income",
            "symbol":"IE00B11XZ988.USD",
            "tigerVault":false,
            "tradeable":true
        },
        {
            "companyName":"富兰克林邓普顿投资",
            "currency":"HKD",
            "dividendType":"INC",
            "market":"MF",
            "name":"邓普顿环球总收益基金A (Mdis)HKD",
            "secType":"FUND",
            "subType":"Fixed Income",
            "symbol":"LU0476943708.HKD",
            "tigerVault":false,
            "tradeable":true
        }
    ],
    "message":"success",
    "sign":"yx8Wv8c1VlcdyWunteBWpW+xdQQ8pBxN4LGCi/SS230saV26rWjV4xupE04uSmjOBnXz+IUlMGEsgHeIXI18XuZh89n4aeC4djkDbmFzchSCTtgaN8icav8H5SKYUuzrkriKQPsZOUpCREJyDSplvVwnhC+yJIK81M7XILgDTMU=",
    "success":true,
    "timestamp":1690871506499
}

获取基金最新行情

对应的请求类:FundQuoteRequest

说明

获取基金最新行情

参数

参数类型是否必填描述
symbolsList<String>yes基金代码,上限为500个

返回com.tigerbrokers.stock.openapi.client.https.response.fund.FundQuoteResponsesourceopen in new window

结构如下:

public class FundQuoteResponse extends TigerResponse {
  @JSONField(name = "data")
  private List<FundQuoteItem> quoteItems;
}

返回数据可通过FundQuoteResponse.getQuoteItems()方法访问,返回FundQuoteItem对象列表,其中items属性列表的com.tigerbrokers.stock.openapi.client.https.domain.fund.item.FundQuoteItem 属性如下:

字段类型说明
symbolstring标的代码
closefloat收市价
timestamplong时间戳

具体字段可通过对象的get方法,如getSymbol()进行访问

示例

    List<String> symbols = new ArrayList<>();
    symbols.add("IE00B11XZ988.USD");
    symbols.add("LU0476943708.HKD");

    FundQuoteRequest request = FundQuoteRequest.newRequest(symbols);
    FundQuoteResponse response = client.execute(request);
    if (response.isSuccess()) {
      System.out.println(JSONObject.toJSONString(response));
    } else {
      System.out.println("response error:" + response.getMessage());
    }

返回示例

{
    "code":0,
    "data":[
        {
            "close":25.33,
            "symbol":"IE00B11XZ988.USD",
            "timestamp":1690732800000
        },
        {
            "close":5.36,
            "symbol":"LU0476943708.HKD",
            "timestamp":1690732800000
        }
    ],
    "message":"success",
    "sign":"lRsJPcIf/NfEoTAKH+cR0S1F3dSNuxntCBZ13BaZKVjrjSbUZEg2epbeaqWrxzxnnoXSl66dbrHuQ7+F3TKmYIjjpO0ZcZbhLMdclO0AQWRrrCtpmytMIQSuLsGWqhO+N0mNAVgMCBGWB8Af4kZOZw3K6IPP9abTLKeteDH5zNk=",
    "success":true,
    "timestamp":1690873154646
}

获取基金历史行情

对应的请求类:FundHistoryQuoteRequest

说明

获取基金历史行情

参数

参数类型是否必填描述
symbolsList<String>Yes基金代码,上限为500个
begin_timeLongYes开始时间戳,单位:毫秒(ms)
end_timeLongYes结束时间戳,单位:毫秒(ms)
limitintegerNo请求返回单个标的数据量

返回com.tigerbrokers.stock.openapi.client.https.response.fund.FundHistoryQuoteResponsesourceopen in new window

结构如下:

public class FundHistoryQuoteResponse extends TigerResponse {
  @JSONField(name = "data")
  private List<FundHistoryQuoteItem> quoteItems;
}

返回数据可通过FundHistoryQuoteResponse.getQuoteItems()方法访问,返回FundHistoryQuoteItem对象列表,其中items属性列表的com.tigerbrokers.stock.openapi.client.https.domain.fund.item.FundHistoryQuoteItem 属性如下:

字段类型说明
symbolstring标的代码
itemsList<FundQuotePoint>历史行情列表

FundQuotePoint属性如下:

字段类型说明
navdouble净值
timelong时间戳

具体字段可通过对象的get方法,如getNav()进行访问

示例

    List<String> symbols = new ArrayList<>();
    symbols.add("IE00B11XZ988.USD");
    symbols.add("LU0476943708.HKD");

    FundHistoryQuoteRequest request = FundHistoryQuoteRequest.newRequest(symbols);
    request.beginTime(DateUtils.getTimestamp("2023-07-01", TimeZoneId.Shanghai));
    request.endTime(DateUtils.getTimestamp("2023-07-26", TimeZoneId.Shanghai));
    request.limit(5);
    FundHistoryQuoteResponse response = client.execute(request);
    if (response.isSuccess()) {
      System.out.println(JSONObject.toJSONString(response));
    } else {
      System.out.println("response error:" + response.getMessage());
    }

返回示例

{
    "code":0,
    "data":[
        {
            "items":[
                {
                    "nav":25.38,
                    "time":1690300800000
                },
                {
                    "nav":25.31,
                    "time":1690214400000
                },
                {
                    "nav":25.34,
                    "time":1690128000000
                },
                {
                    "nav":25.37,
                    "time":1689868800000
                },
                {
                    "nav":25.36,
                    "time":1689782400000
                }
            ],
            "symbol":"IE00B11XZ988.USD"
        },
        {
            "items":[
                {
                    "nav":5.39,
                    "time":1690300800000
                },
                {
                    "nav":5.38,
                    "time":1690214400000
                },
                {
                    "nav":5.39,
                    "time":1690128000000
                },
                {
                    "nav":5.38,
                    "time":1689868800000
                },
                {
                    "nav":5.4,
                    "time":1689782400000
                }
            ],
            "symbol":"LU0476943708.HKD"
        }
    ],
    "message":"success",
    "sign":"uG/+KZ4w5Rzroex9jQECO57WH5rv0HlkRY3O+otB3nyAS3+L3+owhfBsowNkKABJn7GdIw8VvBgBnMZXW2BdfLaq50S99QwZ4OAW0oxeA708QMdoB/BN3O0CReo+ztgDVpJVyImQDJnOHgsOaqyqzc7cNoDwnc0e2h1ETv6JZtw=",
    "success":true,
    "timestamp":1690875443405
}
上次编辑于: