跳到主要内容

交易 K 线窗口

GET/research/experiments/{id}/strategies/{code}/trades/{kline_key}/kline在线调试
GET https://api.shengkezhi.com/open/v1/research/experiments/a79dfc93b7e64a6cbbe26f2a787a6bad/strategies/FTS_1D_0UCFSYXF/trades/SF999.ZCE%257C2017-08-07T16%253A00%253A00%257C2017-08-23T16%253A00%253A00/kline
等效 curl
curl "https://api.shengkezhi.com/open/v1/research/experiments/a79dfc93b7e64a6cbbe26f2a787a6bad/strategies/FTS_1D_0UCFSYXF/trades/SF999.ZCE%257C2017-08-07T16%253A00%253A00%257C2017-08-23T16%253A00%253A00/kline" \
  -H "Authorization: Bearer sk_xxx"

GET /research/experiments/{id}/strategies/{code}/trades/{kline_key}/kline — 交易 K 线窗口。

需在请求头携带 Authorization: Bearer sk_xxx

请求参数

参数位置类型必填默认值说明
idpathstring-策略探索实验编号
codepathstring-候选策略编号
kline_keypathstring-关键交易列表返回的 K 线定位键

响应 data

字段类型必填说明
barsKlineBar[]出入场前后截取的 K 线窗口序列,按时间升序。
entryobject
exitobject
symbolstring该笔交易的标的代码。

KlineBar 字段

字段类型必填说明
timestring该 K 线的时间戳,来自 weights.featherdt 列,ISO 本地时间。
onumber开盘价(复权后,与回测同源)。
hnumber最高价(复权后,与回测同源)。
lnumber最低价(复权后,与回测同源)。
cnumber收盘价(复权后,与回测同源)。
volnumber成交量。
amountnumber成交额。
weightnumber该 K 线上策略给该标的的持仓权重,来自 weights.featherweight 列,正为多头、负为空头。

KlineMarker 字段

字段类型必填说明
timestring标记发生的时间,开仓标记为开仓时刻、平仓标记为平仓时刻。
pricenumber标记价位,取标记时刻对应 K 线的收盘价。
sidestring | null交易方向(多头或空头);仅开仓标记带此字段,平仓标记省略。

调用示例

curl -X GET "https://api.shengkezhi.com/open/v1/research/experiments/a79dfc93b7e64a6cbbe26f2a787a6bad/strategies/FTS_1D_0UCFSYXF/trades/SF999.ZCE%7C2017-08-07T16%3A00%3A00%7C2017-08-23T16%3A00%3A00/kline" \
-H "Authorization: Bearer sk_xxx"
{
"code": 0,
"msg": "ok",
"data": {
"symbol": "SF999.ZCE",
"bars": [
{
"time": "2017-06-26T16:00:00",
"o": 4918.615238196536,
"h": 4933.281254560894,
"l": 4911.282230014357,
"c": 4924.11499433317,
"vol": 42.0,
"amount": 1128500.0,
"weight": -0.3333
},
{
"time": "2017-06-27T16:00:00",
"o": 4927.78149842426,
"h": 4949.7805229707965,
"l": 4909.448977968812,
"c": 4935.114506606438,
"vol": 142.0,
"amount": 3818200.0,
"weight": -0.2143
},
{
"time": "2017-06-28T16:00:00",
"o": 4964.446539335155,
"h": 4966.279791380699,
"l": 4900.282717741088,
"c": 4903.9492218321775,
"vol": 78.0,
"amount": 2095000.0,
"weight": 0.25
}
],
"entry": {
"time": "2017-08-07T16:00:00",
"price": 5510.755648907487,
"side": "多头"
},
"exit": {
"time": "2017-08-23T16:00:00",
"price": 6830.697121699699
}
}
}```