Skip to content

K 线形态分析 ​

GET /api/v1.0/quote/{symbol}/kline-shape

识别指定股票在日 K 或 60 分 K 下当前命中的 K 线形态、关键控制点坐标与辅助线,若命中有效形态则自动串联查询该形态未来 3 天预测涨跌概率/目标区间及历史回测胜率统计。 当标的无明显形态时,kline_shape 返回 0(shape_name='NONE')。

请求参数 ​

参数类型位置必填说明
symbolstring路径是标的代码(路径参数),例: US.TSLA / HK.00700
ktypeint查询否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_shapestring命中的形态 ID(0=当前未命中任何形态)
data.shape_namestring形态枚举名称
data.directionstring多空方向:BULLISH=看涨 / BEARISH=看跌 / NONE=无形态
data.shape_briefstring形态简介说明
data.pointsobject形态关键控制点坐标列表
data.points[].timestampinteger控制点时间(毫秒时间戳)
data.points[].pricenumber控制点价格
data.forecastobject未来 3 天走势预测数据(命中形态时返回)
data.forecast[].rise_probnumber未来 3 天上涨概率(百分数,原始值放大 10^9,除以 10^7 得百分数)
data.forecast[].rise_upper_boundnumber未来 3 天预测涨幅上限(百分数)
data.forecast[].rise_lower_boundnumber未来 3 天预测跌幅下限(百分数)
data.forecast[].price_upper_boundnumber未来 3 天预测价格上限
data.forecast[].price_lower_boundnumber未来 3 天预测价格下限
data.forecast[].is_riskstring是否高风险
data.backtest_statisticobject历史同形态回测统计数据(命中形态时返回)
data.backtest_statistic[].total_countinteger历史出现总次数
data.backtest_statistic[].profit_probnumber历史盈利概率(百分数)
data.backtest_statistic[].rise_upper_boundnumber历史平均涨幅上限(百分数)
data.backtest_statistic[].rise_lower_boundnumber历史平均跌幅下限(百分数)
data.backtest_statistic[].annual_periodinteger回测统计年限(年)

错误码 ​

ret_codeerror.code说明
0—成功
-3invalid_parameter参数缺失或不在允许范围内
-7invalid_symbol标的不存在
-8unsupported市场或品类不支持
-9permission_denied没有对应权限
-10no_data没有可返回的数据
-11rate_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"
  }
}