基金

大约 3 分钟

获取基金代码列表

对应的请求类:TigerRequest(QuoteApiService.FUND_ALL_SYMBOLS)

说明

获取所有基金代码列表

参数

参数类型是否必填描述
  • | - | - | -

返回

TigerOpenAPI.Model.TigerListStringResponsesourceopen in new window

具体结构如下

namespace TigerOpenAPI.Model
{
  public class TigerListStringResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<string> Data { get; set; }
  }
}

返回数据可以通过TigerListStringResponse.Data属性访问,结果为包含返回基金代码数据的List

示例

  static async Task<TigerListStringResponse?> GetAllFundSymbolsAsync(QuoteClient quoteClient)
  {
    TigerRequest<TigerListStringResponse> request = new TigerRequest<TigerListStringResponse>()
    {
      ApiMethodName = QuoteApiService.FUND_ALL_SYMBOLS,
      ModelValue = new FundSymbolModel()
    };
    return await quoteClient.ExecuteAsync(request);
  }

返回示例

{
    "data":[
        "IE00B11XZ988.USD",
        "IE00B7SZLL34.SGD",
        "LU0790902711.USD",
        "LU0476943708.HKD",
        "LU0098860793.USD",
        "SG9999014039.USD"
        // ....
    ],
    "code":0,
    "message":"success",
    "timestamp":1690884638843,
    "sign":"GT6z3Isx728/RkfMJqlyVkqZ4o+hx+oidIaB9yu9YfwEZYOV676de92u6EwYmIEzHPfMfmfH4b25139UKxFLJ2i+IM/XXJBCLVKjVzdr9sCcShfhBrm9SBLQlA76mprAYFlyaDq0jq/R/tjfsI0BvLEe4LwwsUg143QtzWWhe8Q="
}

获取基金合约信息

对应的请求类:TigerRequest(QuoteApiService.FUND_CONTRACTS)

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

输入参数

TigerOpenAPI.Quote.Model.FundSymbolModel

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

返回

TigerOpenAPI.Quote.Response.FundContractsResponsesourceopen in new window

其中数据项字段如下 TigerOpenAPI.Quote.Response.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是否为老虎钱袋子

示例

  static async Task<FundContractsResponse?> GetFundContractsAsync(QuoteClient quoteClient)
  {
    TigerRequest<FundContractsResponse> request = new TigerRequest<FundContractsResponse>()
    {
      ApiMethodName = QuoteApiService.FUND_CONTRACTS,
      ModelValue = new FundSymbolModel()
      {
        Symbols = new List<string>()
        {
          "HK0000910932.HKD",
          "IE00B464Q616.USD"
        },
        Lang = Language.en_US
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

返回示例

{
    "data":[
        {
            "symbol":"HK0000910932.HKD",
            "name":"博时港元货币市场ETF(非上市类别)类别A HKD",
            "companyName":"Bosera Asset Management(Intl) Co., Ltd.",
            "market":"MF",
            "secType":"FUND",
            "currency":"HKD",
            "tradeable":true,
            "subType":"Vault",
            "dividendType":"",
            "tigerVault":true
        },
        {
            "symbol":"IE00B464Q616.USD",
            "name":"PIMCO GIS 新兴亚洲债券基金 E Inc",
            "companyName":"太平洋全球顾问(爱尔兰)有限公司",
            "market":"MF",
            "secType":"FUND",
            "currency":"USD",
            "tradeable":true,
            "subType":"Fixed Income",
            "dividendType":"INC",
            "tigerVault":false
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1690891224833,
    "sign":"TRNddSeDIUm3bu5O+gVHLvx2XZIb6S0mOjB2++6e8XfYQMTRiHK4QlXPWYs2eheIf2wdwzujj5iaKUXl4fUA3AJoqdPGTHbpiGM5etX8XzSmRY2dxQeEfs4ETPBeDUaCbuDWH/2tEM8iBeqLPRS7cC6hael/k2nf7/iwNbw68RM="
}

获取基金最新行情

对应的请求类:TigerRequest(QuoteApiService.FUND_QUOTE)

说明

获取基金最新行情

参数

TigerOpenAPI.Quote.Model.FundSymbolModel

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

返回TigerOpenAPI.Quote.Response.FundQuoteResponsesourceopen in new window

结构如下:

namespace TigerOpenAPI.Quote.Response
{
  public class FundQuoteResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<FundQuoteItem> Data { get; set; }
  }
}

返回数据可通过FundQuoteResponse.Data属性访问,返回FundQuoteItem对象列表,其中items属性列表的TigerOpenAPI.Quote.Response.FundQuoteItem 属性如下:

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

具体字段可通过对象的属性获取,如FundQuoteItem.Symbol进行访问

示例

  static async Task<FundQuoteResponse?> GetFundQuoteAsync(QuoteClient quoteClient)
  {
    TigerRequest<FundQuoteResponse> request = new TigerRequest<FundQuoteResponse>()
    {
      ApiMethodName = QuoteApiService.FUND_QUOTE,
      ModelValue = new FundSymbolModel()
      {
        Symbols = new List<string>()
        {
          "HK0000910932.HKD",
          "IE00B464Q616.USD"
        },
        Lang = Language.en_US
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

返回示例

{
    "data":[
        {
            "symbol":"HK0000910932.HKD",
            "close":10.1587,
            "timestamp":1690819200000
        },
        {
            "symbol":"IE00B464Q616.USD",
            "close":6.91,
            "timestamp":1690732800000
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1690892092527,
    "sign":"MQ9mddIwfM1SCqE2+p2olBlAmzqR9aH7Ly47MKTkzOGVOpR0ZhQgs2ESLdTfkEaxFZEHIV1tqHajPvtdNy9RXWytkzhq937krkMuMrs3VIspJoTgHI7ixGhDfhQo1wak7C6PWjLCkITr4j+EKjrFe4G1dAddG9zOIyW+oSYb75I="
}

获取基金历史行情

对应的请求类:TigerRequest(QuoteApiService.FUND_HISTORY_QUOTE)

说明

获取基金历史行情

参数

TigerOpenAPI.Quote.Model.FundQuoteHistoryModel

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

返回TigerOpenAPI.Quote.Response.FundHistoryQuoteResponsesourceopen in new window

结构如下:

namespace TigerOpenAPI.Quote.Response
{
  public class FundHistoryQuoteResponse : TigerResponse
  {
    [JsonProperty(PropertyName = "data")]
    public List<FundHistoryQuoteItem> Data { get; set; }
  }
}

返回数据可通过FundHistoryQuoteResponse.Data 属性访问,返回FundHistoryQuoteItem对象列表,其中items属性列表的TigerOpenAPI.Quote.Response.FundHistoryQuoteItem 属性如下:

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

FundQuotePoint属性如下:

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

具体字段可通过对象的属性,如FundQuotePoint.Nav进行访问

示例

  static async Task<FundHistoryQuoteResponse?> GetFundHistoryQuoteAsync(QuoteClient quoteClient)
  {
    TigerRequest<FundHistoryQuoteResponse> request = new TigerRequest<FundHistoryQuoteResponse>()
    {
      ApiMethodName = QuoteApiService.FUND_HISTORY_QUOTE,
      ModelValue = new FundQuoteHistoryModel()
      {
        Symbols = new List<string>()
        {
          "HK0000910932.HKD",
          "IE00B464Q616.USD"
        },
        BeginTime = DateUtil.ConvertTimestamp("2023-07-01 09:00:00", CustomTimeZone.HK_ZONE),
        EndTime = DateUtil.ConvertTimestamp("2023-07-26 20:00:00", CustomTimeZone.HK_ZONE),
        Limit = 5,
        Lang = Language.en_US
      }
    };
    return await quoteClient.ExecuteAsync(request);
  }

返回示例

{
    "data":[
        {
            "symbol":"HK0000910932.HKD",
            "items":[
                {
                    "nav":10.1508,
                    "time":1690300800000
                },
                {
                    "nav":10.1496,
                    "time":1690214400000
                },
                {
                    "nav":10.1483,
                    "time":1690128000000
                },
                {
                    "nav":10.1444,
                    "time":1689868800000
                },
                {
                    "nav":10.1431,
                    "time":1689782400000
                }
            ]
        },
        {
            "symbol":"IE00B464Q616.USD",
            "items":[
                {
                    "nav":6.91,
                    "time":1690300800000
                },
                {
                    "nav":6.9,
                    "time":1690214400000
                },
                {
                    "nav":6.9,
                    "time":1690128000000
                },
                {
                    "nav":6.92,
                    "time":1689868800000
                },
                {
                    "nav":6.94,
                    "time":1689782400000
                }
            ]
        }
    ],
    "code":0,
    "message":"success",
    "timestamp":1690892757879,
    "sign":"NO+L4TXXk6Z3Cp6gfINA3EVnyIaZSkv7uyOMtFjja3OHOzKJikUKf/eNfo5eo2chzi/nqwpHUMt8H1A1Sq0Mr8XqWBn6kPxjKvDk0aoJgWNoxEAmcDz1pTjXhF42gK2ylZzJcR8bpccA+jMAYiaXzbx7cXtYMYxPBx1TqjdXY9Y="
}
上次编辑于: