相似 K 線
GET/api/v1.0/quote/{symbol}/similar-kline查詢與指定股票近期 K 線走勢高度相似的歷史樣本統計及最相似標的走勢對比。 返回包含:匹配到的相似歷史樣本總數(similar_count)、次日上漲樣本數(up_count)、次日下跌樣本數(down_count)、歷史最大漲幅(max_up_pct)與最大跌幅(max_down_pct),以及最相似標的列表(similar_stocks,含相似度 similarity、匹配區間 K 線與後續 20 根趨勢 K 線)。
請求參數
| 參數 | 類型 | 位置 | 必填 | 說明 |
|---|---|---|---|---|
symbol | string | 路徑 | 是 | 股票代碼(路徑參數),例: US.TSLA / US.AAPL / HK.00700 |
請求示例
bash
curl -X GET 'https://webapi.moomoo.com/api/v1.0/quote/US.AAPL/similar-kline' \
-H 'Authorization: Bearer <AccessToken>' | jq響應參數
| 參數 | 類型 | 說明 |
|---|---|---|
data.similar_count | integer | 匹配到的歷史相似 K 線樣本總數 |
data.up_count | integer | 後續上漲樣本數 |
data.down_count | integer | 後續下跌樣本數 |
data.max_up_pct | number | 相似樣本最大漲幅(百分數,7.05 表示 +7.05%) |
data.max_down_pct | number | 相似樣本最大跌幅(百分數,-6.99 表示 -6.99%) |
data.similar_stocks | object | 高度相似的歷史標的走勢列表 |
data.similar_stocks[].code | string | 相似標的代碼 |
data.similar_stocks[].name | string | 相似標的名稱 |
data.similar_stocks[].similarity | number | 相似度(百分數) |
錯誤碼
| 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": {
"similar_count": 0,
"up_count": 0,
"down_count": 0,
"max_up_pct": "example",
"max_down_pct": "example",
"similar_stocks": "example"
}
}