Candlestick Pattern Analysis
GET/api/v1.0/quote/{symbol}/kline-shapeDetect the current K-line chart pattern, key control points, and trend lines for a stock on daily or 60-min bars, and automatically chain 3-day price forecast and historical backtest win-rate statistics when a pattern is active.
Request
| Parameter | Type | In | Required | Description |
|---|---|---|---|---|
symbol | string | path | yes | Stock symbol (path param), e.g. US.TSLA / HK.00700 |
ktype | int | query | no | K-line period: 2=Daily (default) / 9=60-minute |
Example
bash
curl -X GET 'https://webapi.futunn.com/api/v1.0/quote/US.AAPL/kline-shape?ktype=1' \
-H 'Authorization: Bearer <AccessToken>' | jqResponse
| Field | Type | Description |
|---|---|---|
data.kline_shape | string | Detected pattern ID (0 = no active pattern) |
data.shape_name | string | Pattern enum name |
data.direction | string | Direction: BULLISH / BEARISH / NONE |
data.shape_brief | string | Pattern description |
data.points | object | Pattern key control points |
data.points[].timestamp | integer | Control point timestamp in milliseconds |
data.points[].price | number | Control point price |
data.forecast | object | 3-day price forecast (present when pattern is active) |
data.forecast[].rise_prob | number | 3-day probability of rising (percent) |
data.forecast[].rise_upper_bound | number | 3-day forecast return upper bound (percent) |
data.forecast[].rise_lower_bound | number | 3-day forecast return lower bound (percent) |
data.forecast[].price_upper_bound | number | 3-day forecast price upper bound |
data.forecast[].price_lower_bound | number | 3-day forecast price lower bound |
data.forecast[].is_risk | string | Whether high risk flag is set |
data.backtest_statistic | object | Historical backtest statistics for this pattern |
data.backtest_statistic[].total_count | integer | Total historical occurrences |
data.backtest_statistic[].profit_prob | number | Historical win rate (percent) |
data.backtest_statistic[].rise_upper_bound | number | Historical return upper bound (percent) |
data.backtest_statistic[].rise_lower_bound | number | Historical return lower bound (percent) |
data.backtest_statistic[].annual_period | integer | Backtest lookback period in years |
Errors
| ret_code | error.code | Description |
|---|---|---|
| 0 | — | Success |
| -3 | invalid_parameter | Missing or invalid parameter |
| -7 | invalid_symbol | Unknown symbol |
| -8 | unsupported | Market or product is not supported |
| -9 | permission_denied | Missing permission |
| -10 | no_data | No data |
| -11 | rate_limited | Too many requests |
Sample
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"
}
}