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"
  }
}