AI Agent Hub
Back to skills
Cup and Handle Alert v1 icon

Cup and Handle Alert v1

Professional Updated 2026.08.30

Paste the following prompt into your AI chat to install this skill:

Follow https://skillhub.cn/install/skillhub.md to install @user_91e44d7e/cup-handle-alert-v1 into your AI assistant.

About this skill

Problem It Addresses

Manual cup-and-handle screening in equities is slow and easy to bias with hindsight. cup-handle-alert-v1 applies CANSLIM-style cup and handle rules to daily fully adjusted price data, with the goal of producing two trackable signals: D-point confirmation and volume breakout, suitable for a watchlist rather than post-hoc chart fitting.

How It Works

  • Reads data/L1_price/daily_qfq.parquet for L1 daily qfq prices and data/L0_raw/stock_info.parquet for stock metadata.
  • Uses smoothing and extreme-value identification to locate KABCD points, then filters by cup depth, handle duration, recovery at point C, and breakout volume ratio.
  • Full-market scans print new daily alerts and write cup_handle_daily_alerts.csv.
  • Single-stock analysis generates an interactive HTML chart in alerts_html/ for structure review.
  • Output fields include alert_type, breakout_price, breakout_vol_ratio, cup_depth_pct, handle_depth_pct, recovery_pct, and K_price~D_price.
  • Key thresholds include cup depth 10%~40%, handle length 5~25 days, breakout volume ratio >=1.3, and a breakout at least 1% above the cup rim.

Boundaries and Caveats

This skill is for daily pattern screening, not an order execution system. Breakout alerts still need to be judged against liquidity, spreads, market risk, and company-specific events. Missing data, trading suspensions, or changed adjustment methods can reduce result coverage. The parameters are conservative; intraday or minute-level use would require different data granularity and trigger logic.

Use Cases

  • Screen A-shares daily after close for new cup-handle D-point confirmations.
  • Review whether a stock forms a cup-handle pattern and generate an HTML chart.
  • Check daily watchlist stocks for volume breakouts above the cup rim and export CSV.
  • Pre-backtest filter stocks by cup depth, handle length, and breakout volume ratio.

Best For

  • A-share quant analysts: need automatic post-close screening of cup-handle confirmation and breakout signals.
  • Technical researchers: need to verify KABCD points, cup depth, and recovery while reviewing a stock.
  • Short-term traders: need to decide whether watchlist candidates break out above the cup rim with volume.
  • Strategy developers: need to export threshold-based cup-handle alert fields before backtesting.