跳到主要内容

创建组合

POST/research/portfolios在线调试
POST https://api.shengkezhi.com/open/v1/research/portfolios
等效 curl
curl "https://api.shengkezhi.com/open/v1/research/portfolios" \
  -H "Authorization: Bearer sk_xxx" \
  -H "Content-Type: application/json" \
  --data '{"base_freq":"1d","base_market":"A股","candidate_strategies":["TS_1D_A96ACBB3","CS_1D_B12830AA"],"description":"示例值","portfolio_code":"CN_MULTI_STRATEGY","price_field":"close","rebalance_dates":["2025-01-02","2025-07-01"],"rebalance_method":"equal_weight"}'

POST /research/portfolios — 创建组合。

需在请求头携带 Authorization: Bearer sk_xxx

请求体

字段类型必填说明
base_freqstring基础数据频率,缺省 1d
base_marketstring基础市场代码;必须是服务端支持的市场之一。
candidate_strategiesstring[]候选实盘策略编号,至少一项;云函数从中优化组合层权重。
descriptionstring组合用途或构建思路;缺省为空字符串。
portfolio_codestring新组合编号,1~160 个字符,仅允许字母、数字、下划线和连字符。
price_fieldstring回测价格字段,缺省 close
rebalance_datesstring[]再平衡日期,至少一项,元素格式 YYYY-MM-DD
rebalance_methodstring再平衡方法,缺省 equal_weight

响应 data

字段类型必填说明
portfolio_codestring已受理的组合编号;可用它轮询 GET /api/portfolios
statusstring固定 pending:已受理,正在后台生成。

调用示例

curl -X POST "https://api.shengkezhi.com/open/v1/research/portfolios" \
-H "Authorization: Bearer sk_xxx" \
-H "Content-Type: application/json" \
-d '{"base_freq":"1d","base_market":"A股","candidate_strategies":["TS_1D_A96ACBB3","CS_1D_B12830AA"],"description":"示例值","portfolio_code":"CN_MULTI_STRATEGY","price_field":"close","rebalance_dates":["2025-01-02","2025-07-01"],"rebalance_method":"equal_weight"}'
{
"code": 0,
"data": {
"portfolio_code": "STRAT_MOMENTUM_001",
"status": "pending"
},
"msg": "ok"
}