基金
获取基金代码列表
对应的请求类:TigerRequest(QuoteApiService.FUND_ALL_SYMBOLS)
说明
获取所有基金代码列表
参数
参数 | 类型 | 是否必填 | 描述 |
---|
- | - | - | -
返回
TigerOpenAPI.Model.TigerListStringResponse
source
具体结构如下
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
参数 | 类型 | 是否必填 | 描述 |
---|---|---|---|
symbols | List<String> | Yes | 基金代码列表 如:"IE00B11XZ988.USD" / "LU0790902711.USD" |
lang | string | No | 语言支持: zh_CN,zh_TW,en_US, 默认: en_US |
返回
TigerOpenAPI.Quote.Response.FundContractsResponse
source
其中数据项字段如下 TigerOpenAPI.Quote.Response.FundContractItem
名称 | 示例 | 说明 |
---|---|---|
symbol | IE00B464Q616.USD | 基金代码,后缀为货币 |
name | ASIA STRATEGIC INTEREST BOND FUND "E" (USD) INC MONTHLY | 基金名称 |
companyName | PIMCO Global Advisors (Ireland) Limited | 基金名称 |
market | US | 市场 /US/HK/CN |
secType | FUND | 合约类别 |
currency | USD | USD/HKD/CNH |
tradeable | true | 是否可交易 |
subType | Fixed Income | 子类别 |
dividendType | INC | 分红类型 |
tigerVault | false | 是否为老虎钱袋子 |
示例
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
参数 | 类型 | 是否必填 | 描述 |
---|---|---|---|
symbols | List<String> | yes | 基金代码,上限为500个 |
返回TigerOpenAPI.Quote.Response.FundQuoteResponse
source
结构如下:
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
属性如下:
字段 | 类型 | 说明 |
---|---|---|
symbol | string | 标的代码 |
close | float | 收市价 |
timestamp | long | 时间戳 |
具体字段可通过对象的属性获取,如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
参数 | 类型 | 是否必填 | 描述 |
---|---|---|---|
symbols | List<String> | Yes | 基金代码,上限为500个 |
begin_time | Long | Yes | 开始时间戳,单位:毫秒(ms) |
end_time | Long | Yes | 结束时间戳,单位:毫秒(ms) |
limit | integer | No | 请求返回单个标的数据量 |
返回TigerOpenAPI.Quote.Response.FundHistoryQuoteResponse
source
结构如下:
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
属性如下:
字段 | 类型 | 说明 |
---|---|---|
symbol | string | 标的代码 |
items | List<FundQuotePoint> | 历史行情列表 |
FundQuotePoint
属性如下:
字段 | 类型 | 说明 |
---|---|---|
nav | double | 净值 |
time | long | 时间戳 |
具体字段可通过对象的属性,如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="
}