跳到主要内容

实盘策略分品种日收益

GET/research/strategies/{code}/symbol-daily-returns在线调试
GET https://api.shengkezhi.com/open/v1/research/strategies/STRAT_ALPHA/symbol-daily-returns?symbol=BBB&start_date=2024-01-04&end_date=2024-01-05&page=1&page_size=1000
等效 curl
curl "https://api.shengkezhi.com/open/v1/research/strategies/STRAT_ALPHA/symbol-daily-returns?symbol=BBB&start_date=2024-01-04&end_date=2024-01-05&page=1&page_size=1000" \
  -H "Authorization: Bearer sk_xxx"

GET /research/strategies/{code}/symbol-daily-returns — 实盘策略分品种日收益。

需在请求头携带 Authorization: Bearer sk_xxx。

请求参数​

参数位置类型必填默认值说明
codepathstring是-策略编号
symbolquerystring否-精确筛选单个品种代码;不传或传空字符串时返回全部品种。
start_datequerystring否-起始交易日(含),格式 YYYY-MM-DD。
end_datequerystring否-结束交易日(含),格式 YYYY-MM-DD。
pagequeryinteger否-页码,从 1 起,默认 1。
page_sizequeryinteger否-每页条数,默认 1000,上限 5000。

响应 data​

字段类型必填说明
aggregation_methodstring是品种贡献聚合方式:mean 对应 ts,sum 对应 cs。
itemsSymbolDailyReturnItem[]是当前分页的按品种日收益明细,按日期、品种升序排列。
pageinteger是当前页码,从 1 起。
page_sizeinteger是每页条数。
strategystring是策略编号。
totalinteger是满足过滤条件的总行数(分页前)。
weight_typestring是策略权重口径:ts 或 cs。

SymbolDailyReturnItem 字段​

字段类型必填说明
datestring是交易日期,格式 YYYY-MM-DD。
symbolstring是品种或证券代码。
raw_returnnumber是该品种自身的原始日收益;同一自然日有多条记录时取加总值。
contributionnumber是该品种对策略当日收益的实际贡献。ts 按当日有效品种数均分,cs 等于原始日收益。

调用示例​

curl -X GET "https://api.shengkezhi.com/open/v1/research/strategies/STRAT_ALPHA/symbol-daily-returns?symbol=BBB&start_date=2024-01-04&end_date=2024-01-05&page=1&page_size=1000" \
-H "Authorization: Bearer sk_xxx"
{
"code": 0,
"msg": "ok",
"data": {
"strategy": "STRAT_ALPHA",
"weight_type": "ts",
"aggregation_method": "mean",
"items": [
{
"date": "2024-01-04",
"symbol": "BBB",
"raw_return": 0.05,
"contribution": 0.016666666666666666
},
{
"date": "2024-01-05",
"symbol": "BBB",
"raw_return": -0.02,
"contribution": -0.006666666666666667
}
],
"total": 2,
"page": 1,
"page_size": 1000
}
}```