a-share-skill
Four skills for China's A-share market: quotes and indicators, trend-pullback signals, a simulated account and backtests
- 258 ★ on the repository
- Last commit
- MIT
Extended access
Why this level
- The scripts call external market data and news sources
- They install Python dependencies and run scripts on your machine
- Strategy signals can push toward a financial decision, even though the simulator uses a practice account
Install
- Works in
In your terminal, with SkillFoxx CLI
npx skillfoxx add skills/a-share-skillDetects the agents on your machine, shows the access level and pins the version.
Other ways to install
Access and checks
How we reviewExtended accessThe tool runs code or makes network calls and only reads external data.
- The scripts call external market data and news sources
- They install Python dependencies and run scripts on your machine
- Strategy signals can push toward a financial decision, even though the simulator uses a practice account
This is third-party code. Review the repository files before installing.
What it does
a-share-skill is a set of four skills for stocks traded on the Shanghai and Shenzhen exchanges. a-share-data collects data with Python scripts: real-time quotes, minute and historical candles with a choice of price adjustment, technical indicators (MA, MACD, KDJ, RSI, BOLL), financial metrics, company news and announcements, concepts and industries, events such as lock-up expiries, buybacks and shareholder trades, and the Dragon and Tiger list of broker seats. Two strategy skills, a-share-strategy-mainboard-multi-swing-defensive and a-share-strategy-allmarket-multi-swing-defensive, look for entries after a pullback in an uptrend and check exits for open positions. The first covers liquid stocks of the main board; the second adds ChiNext and STAR Market. The candidate list comes from the daily_decisions.py script with the --json flag. a-share-paper-trading keeps a simulated account: it creates an account (called calm1 in the examples), accepts practice buy and sell orders, shows positions, fills and account valuation, and runs a simple backtest. No real money or brokerage account is involved in this chain.
Who it is for. For private investors and analysts who study China's stock market with Claude Code, Cursor or Codex and can read Chinese documentation.
Good fit when
- You need quotes, the last 60 daily candles and MACD for a ticker such as 600519
- You want to scan pullback entry candidates and check whether it is time to exit open positions
- You want to test a strategy on a simulated account with no money put in
- You need news, announcements and events for a company: lock-up expiries, buybacks, shareholder trades
- You want a summary of the CSI 300 index, hot sectors and northbound capital flows
Not a fit when
- You need other countries' markets: the skills are built around the Shanghai and Shenzhen exchanges and their data sources
- You want to execute real trades through a broker: orders are simulated only
- You expect ready investment recommendations: strategy signals are material for analysis and the decision stays with you
- You do not read Chinese: the detailed data and simulator guides are in Chinese
Example request
Use a-share-data: show the latest quote for 600519, 60 daily candles and MACDLimitations
The data skill needs Python 3.9 or newer and the akshare, MyTT, pandas, numpy, requests and beautifulsoup4 packages. Data comes from external sources, so some answers can be incomplete: the status and meta fields in the result show coverage, and the scripts have a fallback source for history. The detailed guides for data and the simulator are written in Chinese. The author reports about 40 percent growth on the simulated account over two months and a loss of about 30 percent in July and August, so past results guarantee nothing.
How to disable. Delete the four a-share-* folders from the agent's skills directory, for example ~/.claude/skills.
FAQ
How do I install a-share-skill in Claude Code?
Clone the repository and copy the four skill folders into ~/.claude/skills with cp -R. For Codex the directory is ~/.agents/skills and for Cursor it is ~/.cursor/skills. Then install the Python packages for a-share-data.
How are tickers specified?
A six-digit number is read as a stock: 000001 is Ping An Bank. Use sh000001 for the Shanghai index; the formats sh600519, sz000001 and 600519.XSHG are supported too.
How do the two strategies differ?
The signal rules are the same. The first strategy scans liquid stocks of the main board, and the second takes a wider pool that includes ChiNext and STAR Market.
What can the simulated account do?
Create an account, place and cancel orders, view positions, orders, fills and account valuation, and run a backtest. All operations are for practice.
What extra skills does the repository have?
Three: macd-second-golden-cross looks for rebound setups with a MACD divergence and a second golden cross below the zero axis, macd-trend-resonance-stock-picker picks stocks by trend and MACD resonance, and tuige-shortline-trading helps decide short-term trades: trigger, invalidation and position grade.
Discussion
No questions or reviews yet.
Related
SkillsA skill with Chinese A-share market data: quotes, research reports, financials, news and 11 more categories from 34 sources, no keys
Thirteen skills for quantitative trading on China's A-share market: AKShare and BaoStock data, Backtrader and RQAlpha backtests, QMT and JoinQuant docs
A skill for analysing sectors of the Chinese A-share market: policy, media, money flows, companies and ETFs with sources and dates
A skill that finds bottlenecks in an industry's supply chain and shortlists A-share, Hong Kong and US stocks with data checks
A skill that queries Arkvol for China, Hong Kong and US market data and retells it with the date, indicators and limits of use
The official Tushare Pro skill: quotes, financial statements, indices and macro data of the Chinese market from a natural-language request
Comparison with similar tools
Cards that share the main search query, and how they differ.
| Tool | Official | Repository stars | Main difference |
|---|---|---|---|
| a-share-skill (this card) | no | 258 | |
| Finance Quant Skills | no | 474 | 13 skills for quant trading on the Chinese market with Backtrader and RQAlpha backtests |
| Claude Equity Research | no | 751 | a plugin for equity analysis reports, for education only |
README in short
The description lists the four skills and gives phrases you can say to the agent. It then shows how to combine the skills from data analysis to execution in the simulator, installation for Codex, Cursor, Claude Code and Qoder, and links to the documentation. It ends by naming three extra skills for MACD rebound setups and short-term trades.
README badge
Original SKILL.md
--- name: a-share-data description: 查询A股行情、历史K线与复权、财务指标、公司新闻公告、概念及入选依据、行业分类与成分、解禁、回购、股东增减持、涨停炸板详情、龙虎榜席位、板块热力图、指数、宏观及A+H上市信息。用于股票数据查询、原始数据测试和数据源异常排查。 --- # A股数据查询 ## 使用方式 从本技能的 `scripts/` 调用取数程序,先按下表选择入口,再按需读取对应参考。代码、依赖和参考文件均随本技能目录安装。 ```bash SKILL_DIR="<本技能安装目录的绝对路径>" cd "$SKILL_DIR" python3 -m pip install akshare MyTT pandas numpy requests beautifulsoup4 ``` Python 3.9+;仅查询公司资讯时只需 requests;新增概念/公司事件/池详情/席位只需 requests,概念的同花顺解析另需 beautifulsoup4。以下示例均从技能根目录执行。 ## 功能与脚本路由 | 用户要查什么 | 入口 | 何时阅读参考 | |---|---|---| | 单票/批量报价、分钟线、大盘指数、龙虎榜、涨跌停、资金流 | `scripts/fetch_realtime.py` | 参数见 [API参考](references/api-reference.md) | | 历史K线、复权选择、分红、交易日历、指数成分、业绩预告/快报、宏观 | `scripts/fetch_history.py` | 普通参数见 [API参考](references/api-reference.md);复权与缓存见 [数据口径](references/data-contracts.md) | | 综合或单项财务指标、某日之前已公告的指标 | `scripts/fetch_history.py` | 先读 [财务日期口径](references/data-contracts.md#财务指标与公告日期) | | MA、MACD、KDJ、RSI、BOLL等技术指标 | `scripts/fetch_technical.py` | [API参考](references/api-reference.md) | | 某公司最近新闻/公告、近7天发生什么 | `scripts/fetch_company_news.py` | [公司资讯](references/company-news.md);优先于全市场业绩或舆情入口 | | 公司有哪些概念、为何入选、同花顺常规/新兴/其他概念 | `scripts/fetch_stock_concepts.py` | 先读 [概念与重点数据说明](references/reference-data.md#公司概念与入选依据);保留供应商依据原文 | | 个股/日期窗口解禁、回购计划及进度、已披露股东增减持 | `scripts/fetch_corporate_actions.py` | 先读 [公司事件说明](references/reference-data.md#解禁回购和股东增减持);按公告/解禁日期分别查询 | | 涨停/炸板的封板时间、炸板次数、封单、连板及原始详情;龙虎榜买卖席位 | `scripts/fetch_market_details.py` | 先读 [池详情与龙虎榜席位](references/reference-data.md#涨停和炸板详情);核对真实交易日及沪深/全A覆盖范围 | | 行业目录、申万1/2/3级分类、指定行业真实成分、行业指数历史 | `scripts/fetch_industry.py` | 先读 [行业目录与成分](references/data-contracts.md#行业目录成分和指数历史) | | 单只/多只股票所属行业与证券名称 | `scripts/fetch_sector_info.py` | [API参考](references/api-reference.md);当前文档化路径加 `--no-concepts` | | 热门行业/概念、涨跌幅榜、热力图、指定板块groupKey成员、市场快讯 | `scripts/fetch_danginvest.py` | 先读 [板块与快讯](references/danginvest-api-reference.md);检查stale | | 个股业绩预告/快报和旧事件聚合入口 | `scripts/fetch_stock_events.py` | [API参考](references/api-reference.md);解禁/回购/增减持优先用新的公司事件入口,未分类新闻不能填成合同/监管事件 | | A+H公司清单、H股上市日期范围 | `scripts/fetch_ah_stocks.py` | [API参考](references/api-reference.md) | | A股赴港递表、聆讯、备案、招股、定价、配售、上市节点 | `scripts/fetch_ah_ipo_timeline.py` | [API参考](references/api-reference.md) | 行业目录/成员与“今天热门板块”是不同查询。SW、东财行业、东财概念、DangInvest的分类分别注明,不能用不同分类标准静默替换。 新增概念、公司事件、池详情和席位统一返回`status/meta/data`,供应商原值放在`raw`。`partial`表示有数据但覆盖不全;分页上限、断源、市场范围受限均须随结果说明。新增入口与完整参数见 [重点数据使用说明书](references/reference-data.md)。 ## 证券代码与取数规则 - 纯数字按股票识别:`000001`为平安银行。上证指数使用`sh000001`;支持`sh600519`、`sz000001`、`600519.XSHG`等格式。 - 优先获取JSON,再按用户所需呈现。用户测试skill或要求原始输出时,完整返回JSON,保留来源、错误、覆盖范围和未知值,不替用户筛选新闻或只摘取几条。 - 查询多只股票优先用脚本的批量入口,保留每只股票成功/失败结果;设置适合任务规模的等待预算。每源超时不等于整批都有相同总耗时保证。 - `updated_at/queried_at`是查询时间;交易日、新闻发布时间、公告日期和缓存的`fetched_at`分别读取,不能互相代替。 - 历史默认`--adjust raw`,可选qfq/hfq;跨源降级必须保持所选口径。只有历史入口支持这里的显式复权参数,实时和技术入口按各自实现提供数据。 - `stale=true`只可作为旧快照呈现。需要最新板块/快讯可显式加`--require-fresh`,无法满足时返回失败;不能把查询成功当作数据最新。