Introduction¶
In A-share quantitative analysis and post-market reviews, Chip Distribution (CYQ) is a common perspective used to determine the proportion of profitable shares, identify cost zones, and assess chip concentration. Similar charts are available in mainstream market software. However, within Agent conversations (such as those in Cursor or Claude Code), models often provide only vague conceptual explanations and struggle to generate numerical values matching market software for specific stocks.
Below is an introduction to the SkillHub community Skill “Stock Chip Distribution Analyzer” (@user_b806c584/stock-cyq-analyzer, current version 1.1.0). It encapsulates volume-price data, triangular distribution models, and local caching into an executable workflow. When users mention chip-related questions, the Agent invokes scripts based on SKILL guidelines to output JSON metrics and chart paths, rather than providing buy or sell conclusions on your behalf.
What is this¶
One-sentence positioning: A lightweight CYQ (Chip Distribution) analysis Skill for A-shares that calculates metrics—such as the proportion of profitable shares, main cost zones, and chip concentration—based on volume-price data, and generates visualization results.
Maintenance and Source: Published as @user_b806c584/stock-cyq-analyzer, sourced from the SkillHub community, categorized under data-analysis. The tags indicate requires_api_key=false (no separate API Key configuration needed). The SkillHub page lists the author as Lenipapa (affiliated with “Keen Security Lab”), updated approximately 5 months ago; the displayed download count is approximately 14,000.
Problem Solved: Replicating “market software-like” chip distribution calculations within Agent sessions. By pulling A-share historical data via akshare and writing it to a local .stock_cache, it prioritizes cache reading during analysis to reduce repetitive network data fetching.
Core Features¶
The following capabilities are derived from the official SKILL.md and package documentation, and can be cross-verified with SkillHub search summaries.
Algorithm and Data¶
- Typical Price:
(Open + High + Low + Close) / 4 - Distribution Assumption: Triangular distribution (parameterized by low, high, and typical prices).
- Historical Decay: Linear decay
(1 - turnover)based on turnover rate. - Price Step: 0.1 CNY.
- Default Lookback: Approximately 180 trading days by default in script comments (subject to the actual length of fetched data).
On the data side, A-share market quotes are obtained via akshare; the Skill description states support for A-share stocks and includes a built-in historical data cache.
Output Metrics¶
| Metric | Description |
|---|---|
| Profitable Share Ratio | The proportion of chips (shares) below the current price. |
| Average Cost | The average cost price for shareholders. |
| Chip Peak | The price with the highest chip density. |
| 90% Chip Concentration | The width of the price range covering 90% of the chips. |
| Main Cost Zone | The price range with the highest chip density (top 20%). |
Running the script outputs standard JSON, containing the above metrics and chart file paths. Official descriptions claim the analysis results are “comparable” to mainstream stock software, but do not guarantee field-by-field consistency with any commercial terminal. It is advisable to compare against your own data using the same data source and adjustment method.
When to use (Agent context)¶
The Skill defines boundaries in the frontmatter:
- Use when: The user mentions “Chip Distribution”, “Chip Analysis”, “CYQ”, “Profitable Shares”, “Main Cost”, “Chip Concentration”, “90% Cost”, etc.
- NOT for: Recommending buy/sell timing, predicting stock price trends, or providing investment advice.
This article adheres to these boundaries: it only explains the tool’s capabilities and does not constitute investment advice.
Installation and Activation¶
Installation involves two layers: first, install the Skill into the current Agent’s skills directory, and second, install Python dependencies within the Skill package.
1. Install SkillHub CLI (if not already installed)¶
Check the CLI according to the SkillHub installation instructions:
command -v skillhub && skillhub --version
If not installed, you can run the full installation or just the CLI:
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash
curl -fsSL https://skillhub-1388575217.cos.ap-guangzhou.myqcloud.com/install/install.sh | bash -s -- --cli-only
2. Install the Skill to the current Agent’s skills directory¶
SkillHub requires using --dir to point to the skills directory actually used by the current Agent during installation. Otherwise, if it defaults to ./skills/, it may not be recognized.
The installation prompt provided on the official page is: Install @user_b806c584/stock-cyq-analyzer according to https://skillhub.cn/install/skillhub.md.
The equivalent command provided by CLI search results is:
skillhub install stock-cyq-analyzer --namespace user_b806c584 --dir <skills directory>
Common skills paths for Agents (excerpted from SkillHub installation docs):
- Cursor:
~/.cursor/skills/ - Claude Code:
~/.claude/skills/ - Codex:
~/.codex/skills/or.agents/skills/under the project
Replace <skills directory> with the corresponding path for your current environment. After installation, follow your client’s instructions to refresh or restart the Agent so the new Skill is loaded.
3. Install Python Dependencies¶
Enter the installed Skill directory and install dependencies before the first analysis run (see requirements.txt in the package for version ranges):
pip3 install -r requirements.txt
Main dependencies include: numpy, pandas, matplotlib, akshare (minimum versions are specified in requirements.txt).
Typical Usage¶
The direct invocation method provided in the Skill documentation is as follows. First, navigate to the scripts directory within the Skill package in the terminal, then pass the 6-digit A-share code (the example is a Shenzhen stock, without exchange suffix):
cd scripts
python3 cyq_analyzer.py <stock_code>
Example:
python3 cyq_analyzer.py 000547
This step fetches or reads cached quotes, calculates CYQ, and prints JSON (containing metrics and chart paths) to standard output. In Agent scenarios, users typically describe the stock and requirements in natural language (e.g., “Check the profitable shares and 90% cost concentration for 000547”), and the model selects the above command or an equivalent path to execute based on SKILL.md.
Chart rendering uses the matplotlib non-interactive backend. If the running environment lacks Chinese fonts, adjustments may be needed based on server font configuration; otherwise, text in the chart may display incorrectly—this point needs verification on the actual deployment machine.
Use Cases and Notes¶
Who is it for
- Developers who need to quickly view chip structure metrics for a single A-share within a conversational development environment, rather than manually transcribing screenshots from market software.
- Research or review workflows hoping to use akshare + local cache to reduce the cost of repetitive data fetching.
- Users already using SkillHub to manage Skills who want to use a unified CLI to install community data analysis capabilities.
Limitations and Notes
- Not an Investment Advisory Tool: The Skill explicitly excludes buy/sell advice and trend prediction; outputs should be used as references for volume-price structure and cannot replace compliance research processes.
- Data and Cache: Quotes come from akshare; network issues, API changes, or individual stock suspensions may affect results. The cache is reused by default within approximately 1 day according to script logic (see
max_age_daysinload_cached_data). If the latest data is required, understand how to refresh or delete the corresponding pickle files under.stock_cache. - Environment Dependencies: Requires a working Python 3 and the aforementioned pip packages; in Linux environments, the font path is hardcoded to a Noto CJK path, which may differ from default macOS/Windows environments.
- Version: Subject to the SkillHub page and installation package; the current public version is 1.1.0. For upgrades, use
skillhubto handle updates according to your environment’s workflow.
Conclusion¶
The “Stock Chip Distribution Analyzer” consolidates CYQ triangular distribution calculations, akshare data, and local caching into a standard SKILL workflow. This enables Agents, when users discuss keywords like chips, profitable shares, or main costs, to deliver reproducible scripts and JSON outputs rather than vague descriptions. If you wish to install it yourself or view details, please refer to:
- Skill Package Address: https://api.skillhub.cn/user_b806c584/stock-cyq-analyzer
- SkillHub Page: https://www.skillhub.cn/skills/user_b806c584/stock-cyq-analyzer
- Installation Instructions: https://skillhub.cn/install/skillhub.md