基金与窝轮牛熊证
获取基金代码列表
功能说明
基金代码列表。
方法签名
func (c *QuoteClient) GetFundSymbols(req model.FundSymbolsRequest) ([]string, error)参数
model.FundSymbolsRequest
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
Lang | string | 否 | 空值省略 | 无;可选值:zh_CN, zh_TW, en_US |
返回
([]string, error)
示例
result, err := qc.GetFundSymbols(model.FundSymbolsRequest{
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)返回示例
[
"SPY",
"QQQ",
"IWM",
"VTI",
"GLD"
]获取基金合约
功能说明
基金合约信息。
方法签名
func (c *QuoteClient) GetFundContracts(req model.FundContractsRequest) ([]model.FundContractInfo, error)参数
model.FundContractsRequest
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
Lang | string | 否 | 空值省略 | 无;可选值:zh_CN, zh_TW, en_US |
Symbols | []string | 否 | 空集合时省略 | 标的代码列表 |
返回
([]model.FundContractInfo, error)。关键字段来自 model.FundContractInfo:
| 字段 | 类型 | JSON 字段 | 说明 |
|---|---|---|---|
Symbol | string | symbol | 基金代码 |
Name | string | name | 基金名称 |
Currency | string | currency | 计价货币 |
FundType | string | fundType | 基金类型 |
Inception | string | inception | 成立日期 |
NetAssetVal | float64 | netAssetValue | 基金净资产值 |
ExpenseRatio | float64 | expenseRatio | 费用率 |
示例
result, err := qc.GetFundContracts(model.FundContractsRequest{
Symbols: []string{"AAPL"},
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)返回示例
[
{
"symbol": "SPY",
"name": "SPDR S&P 500 ETF Trust",
"exchange": "ARCA",
"market": "US",
"secType": "FUND",
"currency": "USD"
},
{
"symbol": "QQQ",
"name": "Invesco QQQ Trust",
"exchange": "NASDAQ",
"market": "US",
"secType": "FUND",
"currency": "USD"
}
]获取基金行情
功能说明
基金实时净值。
方法签名
func (c *QuoteClient) GetFundQuote(req model.FundQuoteRequest) ([]model.FundQuote, error)参数
model.FundQuoteRequest
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
Lang | string | 否 | 空值省略 | 无;可选值:zh_CN, zh_TW, en_US |
Symbols | []string | 否 | 空集合时省略 | 标的代码列表 |
返回
([]model.FundQuote, error)。关键字段来自 model.FundQuote:
| 字段 | 类型 | JSON 字段 | 说明 |
|---|---|---|---|
Symbol | string | symbol | 基金代码 |
LatestNav | float64 | latestNav | 最新单位净值 |
Change | float64 | change | 净值变动额 |
ChangeRate | float64 | changeRate | 净值变动幅度 |
Date | string | date | 净值日期 |
示例
result, err := qc.GetFundQuote(model.FundQuoteRequest{
Symbols: []string{"AAPL"},
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)返回示例
[
{
"symbol": "SPY",
"open": 555.20,
"high": 558.90,
"low": 553.10,
"close": 557.80,
"preClose": 554.60,
"latestPrice": 557.80,
"volume": 45678900,
"status": "NORMAL"
}
]获取基金历史行情
功能说明
基金历史净值。
方法签名
func (c *QuoteClient) GetFundHistoryQuote(req model.FundHistoryQuoteRequest) ([]model.FundHistoryQuote, error)参数
model.FundHistoryQuoteRequest
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
Lang | string | 否 | 空值省略 | 无;可选值:zh_CN, zh_TW, en_US |
Symbols | []string | 否 | 空集合时省略 | 标的代码列表 |
BeginTime | int64 | 否 | 零值时省略 | 开始时间,毫秒时间戳 |
EndTime | int64 | 否 | 零值时省略 | 结束时间,毫秒时间戳 |
Limit | int | 否 | 零值时省略 | 返回数量上限 |
返回
([]model.FundHistoryQuote, error)。关键字段来自 model.FundHistoryQuote:
| 字段 | 类型 | JSON 字段 | 说明 |
|---|---|---|---|
Symbol | string | symbol | 基金代码 |
Date | string | date | 净值日期 |
Nav | float64 | nav | 单位净值 |
示例
result, err := qc.GetFundHistoryQuote(model.FundHistoryQuoteRequest{
Symbols: []string{"AAPL"},
BeginTime: 1735689600000,
EndTime: 1738281600000,
Limit: 20,
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)返回示例
[
{
"symbol": "SPY",
"period": "day",
"items": [
{"time": 1785384000000, "open": 554.60, "high": 556.20, "low": 552.80, "close": 554.60, "volume": 38912000},
{"time": 1785470400000, "open": 555.20, "high": 558.90, "low": 553.10, "close": 557.80, "volume": 45678900}
]
}
]获取窝轮行情
功能说明
获取窝轮实时行情.
方法签名
func (c *QuoteClient) GetWarrantQuote(req model.WarrantBriefsRequest) ([]model.WarrantBrief, error)当前服务端不支持 Go SDK 使用的 warrant_briefs 接口。
参数
model.WarrantBriefsRequest
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
Lang | string | 否 | 空值省略 | 无;可选值:zh_CN, zh_TW, en_US |
Symbols | []string | 否 | 空集合时省略 | 标的代码列表 |
返回
([]model.WarrantBrief, error)。关键字段来自 model.WarrantBrief:
| 字段 | 类型 | JSON 字段 | 说明 |
|---|---|---|---|
Symbol | string | symbol | 窝轮代码 |
Name | string | name | 窝轮名称 |
LatestPrice | float64 | latestPrice | 最新价 |
Change | float64 | change | 涨跌额 |
ChangeRate | float64 | changeRate | 涨跌幅 |
Volume | int64 | volume | 成交量 |
Amount | float64 | amount | 成交额 |
Underlying | string | underlying | 正股代码 |
Issuer | string | issuer | 发行商 |
ExpiryDate | string | expiryDate | 到期日 |
StrikePrice | float64 | strikePrice | 行权价 |
WarrantType | string | warrantType | 窝轮类型 |
示例
result, err := qc.GetWarrantQuote(model.WarrantBriefsRequest{
Symbols: []string{"AAPL"},
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)返回示例
[
{
"symbol": "13579",
"name": "TENCENT CW2508A",
"latestPrice": 0.40,
"volume": 12340000,
"strikePrice": 420.0,
"expiryDate": "2025-08-28"
}
]窝轮筛选
功能说明
窝轮筛选。
方法签名
func (c *QuoteClient) GetWarrantFilter(req model.WarrantFilterRequest) (*model.WarrantFilterResult, error)参数
model.WarrantFilterRequest
| 参数 | 类型 | 必填 | 默认值 | 说明 |
|---|---|---|---|---|
Symbol | string | 否 | 空值省略 | 标的代码 |
Page | int | 否 | 零值省略 | 页码 |
PageSize | int | 否 | 零值省略 | 每页数量 |
SortFieldName | string | 否 | 空值省略 | 排序字段 |
SortDir | string | 否 | 空值省略 | 无;可选值:SortDir_No, SortDir_Ascend, SortDir_Descend |
IssuerName | string | 否 | 空值省略 | 发行商名称 |
ExpireYm | string | 否 | 空值省略 | 到期年月 |
Lang | string | 否 | 空值省略 | 无;可选值:zh_CN, zh_TW, en_US |
SDK 不设置排序、页大小或区间边界默认值。
返回
(*model.WarrantFilterResult, error)。关键字段来自 model.WarrantFilterResult:
| 字段 | 类型 | JSON 字段 | 说明 |
|---|---|---|---|
Total | int | total | 结果总数 |
Items | []WarrantBrief | items | 窝轮列表 |
PageSize | int | pageSize | 每页结果数量 |
Page | int | page | 当前页码 |
WarrantBrief 字段
| 字段 | 类型 | JSON 字段 | 说明 |
|---|---|---|---|
Symbol | string | symbol | 窝轮代码 |
Name | string | name | 窝轮名称 |
LatestPrice | float64 | latestPrice | 最新价 |
Change | float64 | change | 涨跌额 |
ChangeRate | float64 | changeRate | 涨跌幅 |
Volume | int64 | volume | 成交量 |
Amount | float64 | amount | 成交额 |
Underlying | string | underlying | 正股代码 |
Issuer | string | issuer | 发行商 |
ExpiryDate | string | expiryDate | 到期日 |
StrikePrice | float64 | strikePrice | 行权价 |
WarrantType | string | warrantType | 窝轮类型 |
示例
result, err := qc.GetWarrantFilter(model.WarrantFilterRequest{
Symbol: "AAPL",
Page: 1,
PageSize: 20,
Lang: "en_US",
})
if err != nil {
log.Fatal(err)
}
fmt.Printf("%#v\n", result)返回示例
{
"total": 1,
"items": [
{
"symbol": "13579",
"name": "TENCENT CW2508A",
"underlying": "00700",
"warrantType": "CALL",
"strikePrice": 420.0,
"expiryDate": "2025-08-28",
"issuer": "GS",
"latestPrice": 0.40,
"volume": 12340000
}
],
"pageSize": 20,
"page": 1
}调用频率
基础限流为 60 次/分钟。
Updated 17 days ago
Did this page help you?
