Preface¶
When performing technical analysis on A-shares, common practices include opening market software to manually draw fractals (分型), strokes (笔), and pivot zones (中枢), or relying solely on local scripts to calculate MACD and moving averages. Chan Theory (Chanlun) emphasizes the geometric structure from K-lines to trend types, as well as buy/sell points under multi-level alignment. Generic indicator scripts often fail to cover this comprehensively, and Agents struggle to output verifiable conclusions consistently without a fixed workflow.
The following introduces the SkillHub community skill chanlun-analysis (coordinates @user_d0c0f066/chanlun-analysis). It utilizes a standard SKILL.md to define analysis steps and includes the chanlun_analysis.py engine to connect fractal identification, strokes, segments, pivot zones, MACD divergence quantification, multi-level matrices, and report generation into a reproducible pipeline. The primary data source is the Eastmoney HTTP interface, and SkillHub marks it with requires_api_key=false, meaning no additional API key is needed.
What is this¶
chanlun-analysis is a community Skill classified as data-analysis, published by user_d0c0f066, with SkillHub package version 1.0.0. The skill description (SKILL.md) positions itself as: A practical stock analysis tool based on the Chan Theory 108-lesson knowledge base, combined with classic trading frameworks like Livermore and Wyckoff. It is designed for Agents to select when users require Chan Theory analysis, buy/sell point judgment, trend analysis, volume-price relationships, multi-level resonance, backtesting, or batch stock selection.
Maintenance information is detailed in the skill metadata: The author is “An An”, and the skill documentation version is v3.0.0 (which differs from the SkillHub listing version; the SKILL.md inside the installation package is the source of truth). The source is community, with a current SkillHub rating of 100000 and 846 downloads (statistics from the page, subject to change over time).
Core Features¶
The following capabilities are derived from the SKILL.md and scripts/chanlun_analysis.py descriptions within the installation package. The Agent executes scripts driven by the documentation.
Trend Structure and Buy/Sell Points¶
- Automated Pipeline: K-line inclusion handling → Fractals (with optional volume-price validity) → Strokes → Segments (using the feature sequence method) → Pivot Zones → Trend Types → Identification of Type 1, 2, and 3 buy/sell points.
- Buy/Sell Point Strength Scoring: Scored from 0–100, weighted by different dimensions for first/second/third buy points, and assigned levels such as “Strong / Watch / Neutral / Weak”.
MACD and Multi-Level Analysis¶
- MACD (12/26/9) Area Divergence: Compares the cumulative area of red/green bars between two trend segments, outputting a divergence degree and grading it as “Strong Divergence / Obvious Divergence”, etc.
- Multi-Level Alignment Matrix: Covers 5/15/30/60-minute, Daily, and Weekly levels by default. It summarizes direction, pivot zones, divergence, buy/sell points, and scores in a table, and judges the strength of multi-level resonance.
Auxiliary Analysis and Risk Control Output¶
- Volume-Price Fractal Filtering: (e.g., filtering for volume expansion on top fractals and volume shrinkage on bottom fractals);
--strict-biallows weak fractals to be excluded from stroke construction. - Trendlines and Channel Lines: Identification of classic patterns (Head and Shoulders, Double Top/Bottom, Triangles, Boxes, etc.).
- Stop Loss/Take Profit: Provides entry, stop loss, and 2:1 / 3:1 target levels based on the lower bound of the pivot zone, previous lows, and ATR(14).
- Simplified Backtesting: (
--backtest, default initial capital 100000) and Batch analysis for custom stock lists (--batch, supports CSV/JSON).
Knowledge Base and Outputs¶
- The package includes
chapters/(108 lessons),glossary.md,patterns.md, andcheatsheet.mdfor the Agent to reference terminology and interpret pattern results. - The script generates Markdown reports, JSON summaries, PNG charts for each level, and batch result files in
./codeact/output/.
Data Sources¶
| Data Source | Role | Description |
|---|---|---|
| Eastmoney API | Primary | HTTP, documented as free and requiring no registration |
| BaoStock | Backup | Documentation notes that sandbox TCP 10030 may be unreachable |
| AKShare | Backup | Documentation notes Python 3.13 compatibility issues |
Installation and Activation¶
1. Install SkillHub CLI (if not already installed)¶
First, check if the CLI exists:
command -v skillhub && skillhub --version
If not installed, follow the SkillHub installation instructions for a full installation:
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
To install only the CLI:
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only
2. Install chanlun-analysis¶
The method provided on the official page is to let the Agent install @user_d0c0f066/chanlun-analysis via https://skillhub.cn/install/skillhub.md.
The command-line equivalent (must use --dir to point to the current Agent’s skills directory, otherwise the default ./skills/ might not be recognized):
skillhub install chanlun-analysis --namespace user_d0c0f066 --dir <your skills directory>
Common paths (also from SkillHub installation docs):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
After installation, restart or refresh the Agent according to your client’s requirements to load the SKILL.md.
3. Python Dependencies¶
The runtime dependencies listed in SKILL.md are: requests, pandas, numpy, mplfinance, matplotlib. Install these packages in the environment where chanlun_analysis.py will be executed. The script path relative to the skill directory is generally:
scripts/chanlun_analysis.py
The documentation specifies Coze Agent Sandbox (Python 3.13) as the primary runtime example. For local use, ensure network access to the Eastmoney interface is available.
Typical Usage¶
Triggering in Agent Conversations¶
When a user requests Chan Theory analysis, buy/sell points, multi-level trends, backtesting, or batch stock selection, the Agent should read this Skill’s SKILL.md and enter the “Invoke Script → Interpret JSON/Markdown Output” workflow. For non-technical parts of the “Three System Resonance” (e.g., valuation relationships, fundamentals), the documentation requires the main Agent to supplement them separately.
Command Line Invocation¶
Navigate to scripts/ under the skill directory or use the full path:
python chanlun_analysis.py <result_mode> <stock_code> [stock_name] [levels] [options]
| Parameter | Required | Description |
|---|---|---|
result_mode |
Yes | notify / display_only / auto |
stock_code |
Yes | e.g., 000001, sh.600519, auto-identifies exchange |
stock_name |
No | Auto-fetched if omitted |
levels |
No | Comma-separated levels: 5, 15, 30, 60, d, w, m |
Official Examples:
# Basic analysis (v3.0 features enabled by default)
python chanlun_analysis.py notify 300308 中际旭创 d,60,30
# Enable backtesting
python chanlun_analysis.py notify 300308 中际旭创 d --backtest
# Strict stroke division
python chanlun_analysis.py notify 000001 平安银行 d --strict-bi
# Batch analysis
python chanlun_analysis.py notify --batch --batch-list "000001,300308,600519" --batch-format both
Common switches (all enabled by default, disable with --no-*): --no-xuanduan, --no-macd, --no-matrix, --no-volume-fractal, --no-scoring, --no-trendline, --no-patterns, --no-risk.
The JSON summary returned by the script contains trend_type, buy_sell_points (including score), divergence, risk_reward, and other fields for each level; see SKILL.md for the full field structure example. Interpretation should refer to the multi-level matrix table and scoring table (thresholds such as ≥80 Strong, ≥60 Watch are fixed in the documentation).
Scenarios and Caveats¶
Who is it for
- Users performing stock research in environments supporting Skills (like Cursor, Claude Code, Codex) who want to solidify structured Chan Theory analysis into repeatable Agent steps.
- Teams or individuals needing multi-level (daily/minute) alignment, divergence quantification, batch stock pool screening, and Markdown reports with K-line charts.
Limitations and Pitfalls
- The skill declares it provides an analysis framework and logic, not investment advice; backtesting is based on historical data, and the documentation explicitly states it does not represent future returns.
- The SkillHub package version (1.0.0) and the
SKILL.mdinternal documentation version (3.0.0) coexist; for troubleshooting, rely on the files in the installation directory. - Backup data sources have environmental restrictions noted in the documentation; production environments should prioritize verifying Eastmoney interface reachability and Python version.
- Minute-level data volume is large; the documentation suggests selecting levels as needed. Batch results are suitable for preliminary screening, but final trading decisions require manual review.
- The documentation emphasizes position and stop-loss discipline; automated stop-loss/take-profit are calculation references only and cannot replace risk control rules.
Conclusion¶
chanlun-analysis consolidates Chan Theory geometric analysis, MACD area divergence, multi-level matrices, and report generation into a single Agent-executable Skill workflow, relying on the Eastmoney primary data source to reduce Key configuration costs. To reproduce this locally, start with the SkillHub installation package and the script parameters in SKILL.md.
- SkillHub Page: https://www.skillhub.cn/skills/user_d0c0f066/chanlun-analysis
- API Entry: https://api.skillhub.cn/user_d0c0f066/chanlun-analysis
- Installation Guide: https://skillhub.cn/install/skillhub.md