K 线形态分析
GET/api/v1.0/quote/{symbol}/kline-shape识别指定股票在日 K 或 60 分 K 下当前命中的 K 线形态、关键控制点坐标与辅助线,若命中有效形态则自动串联查询该形态未来 3 天预测涨跌概率/目标区间及历史回测胜率统计。 当标的无明显形态时,kline_shape 返回 0(shape_name='NONE')。
请求参数
| 参数 | 类型 | 位置 | 必填 | 说明 |
|---|---|---|---|---|
symbol | string | 路径 | 是 | 标的代码(路径参数),例: US.TSLA / HK.00700 |
ktype | int | 查询 | 否 | K 线周期:2=日 K(默认)/ 9=60 分 K |
请求示例
bash
curl -X GET 'https://webapi.moomoo.com/api/v1.0/quote/US.AAPL/kline-shape?ktype=1' \
-H 'Authorization: Bearer <AccessToken>' | jq响应参数
| 参数 | 类型 | 说明 |
|---|---|---|
data.kline_shape | string | 命中的形态 ID(0=当前未命中任何形态) |
data.shape_name | string | 形态枚举名称 |
data.direction | string | 多空方向:BULLISH=看涨 / BEARISH=看跌 / NONE=无形态 |
data.shape_brief | string | 形态简介说明 |
data.points | object | 形态关键控制点坐标列表 |
data.points[].timestamp | integer | 控制点时间(毫秒时间戳) |
data.points[].price | number | 控制点价格 |
data.forecast | object | 未来 3 天走势预测数据(命中形态时返回) |
data.forecast[].rise_prob | number | 未来 3 天上涨概率(百分数,原始值放大 10^9,除以 10^7 得百分数) |
data.forecast[].rise_upper_bound | number | 未来 3 天预测涨幅上限(百分数) |
data.forecast[].rise_lower_bound | number | 未来 3 天预测跌幅下限(百分数) |
data.forecast[].price_upper_bound | number | 未来 3 天预测价格上限 |
data.forecast[].price_lower_bound | number | 未来 3 天预测价格下限 |
data.forecast[].is_risk | string | 是否高风险 |
data.backtest_statistic | object | 历史同形态回测统计数据(命中形态时返回) |
data.backtest_statistic[].total_count | integer | 历史出现总次数 |
data.backtest_statistic[].profit_prob | number | 历史盈利概率(百分数) |
data.backtest_statistic[].rise_upper_bound | number | 历史平均涨幅上限(百分数) |
data.backtest_statistic[].rise_lower_bound | number | 历史平均跌幅下限(百分数) |
data.backtest_statistic[].annual_period | integer | 回测统计年限(年) |
错误码
| ret_code | error.code | 说明 |
|---|---|---|
| 0 | — | 成功 |
| -3 | invalid_parameter | 参数缺失或不在允许范围内 |
| -7 | invalid_symbol | 标的不存在 |
| -8 | unsupported | 市场或品类不支持 |
| -9 | permission_denied | 没有对应权限 |
| -10 | no_data | 没有可返回的数据 |
| -11 | rate_limited | 调用过于频繁 |
响应示例
json
{
"ret_code": 0,
"ret_msg": "success",
"data": {
"kline_shape": "example",
"shape_name": "example",
"direction": "example",
"shape_brief": "example",
"points": "example",
"forecast": "example",
"backtest_statistic": "example"
}
}