Skip to content

Candlestick Pattern Analysis ​

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

Detect 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 ​

ParameterTypeInRequiredDescription
symbolstringpathyesStock symbol (path param), e.g. US.TSLA / HK.00700
ktypeintquerynoK-line period: 2=Daily (default) / 9=60-minute

Example ​

bash
curl -X GET 'https://webapi.moomoo.com/api/v1.0/quote/US.AAPL/kline-shape?ktype=1' \
  -H 'Authorization: Bearer <AccessToken>' | jq

Response ​

FieldTypeDescription
data.kline_shapestringDetected pattern ID (0 = no active pattern)
data.shape_namestringPattern enum name
data.directionstringDirection: BULLISH / BEARISH / NONE
data.shape_briefstringPattern description
data.pointsobjectPattern key control points
data.points[].timestampintegerControl point timestamp in milliseconds
data.points[].pricenumberControl point price
data.forecastobject3-day price forecast (present when pattern is active)
data.forecast[].rise_probnumber3-day probability of rising (percent)
data.forecast[].rise_upper_boundnumber3-day forecast return upper bound (percent)
data.forecast[].rise_lower_boundnumber3-day forecast return lower bound (percent)
data.forecast[].price_upper_boundnumber3-day forecast price upper bound
data.forecast[].price_lower_boundnumber3-day forecast price lower bound
data.forecast[].is_riskstringWhether high risk flag is set
data.backtest_statisticobjectHistorical backtest statistics for this pattern
data.backtest_statistic[].total_countintegerTotal historical occurrences
data.backtest_statistic[].profit_probnumberHistorical win rate (percent)
data.backtest_statistic[].rise_upper_boundnumberHistorical return upper bound (percent)
data.backtest_statistic[].rise_lower_boundnumberHistorical return lower bound (percent)
data.backtest_statistic[].annual_periodintegerBacktest lookback period in years

Errors ​

ret_codeerror.codeDescription
0—Success
-3invalid_parameterMissing or invalid parameter
-7invalid_symbolUnknown symbol
-8unsupportedMarket or product is not supported
-9permission_deniedMissing permission
-10no_dataNo data
-11rate_limitedToo 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"
  }
}