A professional A-share market analysis tool that integrates multiple data sources and provides comprehensive technical and fundamental analysis and intelligent stock selection strategies.
Data Retrieval
Use AKShare as the primary data source (free, open source, no token required):
pip install akshare --break-system-packages
Core Data Retrieval Examples
import akshare as ak
# 实时行情
df = ak.stock_zh_a_spot_em() # 全部A股实时行情
Historical K-line
df = ak.stock_zh_a_hist(symbol="000001", period="daily", adjust="qfq")
Sector Quotesdf = ak.stock_board_concept_name_em() # Concept sectors df = ak.stock_board_industry_name_em() # Industry sectors
Dragon-Tiger List (use the actual query range for dates, format YYYYMMDD)df = ak.stock_lhb_detail_em(start_date="<start date>", end_date="<end date>")
Capital Flowdf = ak.stock_individual_fund_flow(stock="000001", market="sz")
## 分析工作流程
### 1. 每日盘前分析
执行顺序:
1. 获取大盘指数(上证、深证、创业板)
2. 分析板块热点轮动
3. 筛选涨停股及连板股
4. 检测北向资金流向
5. 生成今日关注清单
### 2. 技术面分析
对单只股票执行:
1. 获取历史K线数据(至少60日)
2. 计算技术指标(见 `references/technical_indicators.md`)
3. 识别K线形态(见 `references/candlestick_patterns.md`)
4. 判断趋势和支撑/阻力位
5. 生成技术面评分
### 3. 基本面分析
执行顺序:
1. 获取财务数据(营收、净利润、ROE等)
2. 计算估值指标(PE、PB、PS)
3. 分析行业地位和竞争优势
4. 评估成长性和安全边际
5. 生成基本面评分
### 4. 智能选股策略
**策略类型选择:**
- 多因子综合策略 → 执行 `scripts/strategy_multi_factor.py`(已实现,内置 ST/停牌过滤)
- 趋势突破 / 价值低估 / 动量因子等单因子策略 → 目前无独立脚本,在 multi_factor 基础上调整因子权重,或按需自行实现
## 输出格式
### 个股分析报告模板
```markdown
# [股票名称]([股票代码]) 分析报告
## 基本信息
- 当前价格:¥XX.XX(涨跌幅 +X.XX%)
- 市值:XXX亿 | PE(TTM):XX.X | PB:X.XX
## 技术面分析
- 趋势判断:[上升/震荡/下降]
- 支撑位:¥XX.XX | 阻力位:¥XX.XX
- 技术指标:MACD [金叉/死叉] | KDJ [超买/超卖/中性] | RSI [XX]
## 基本面分析
- 营收增速:XX% | 净利润增速:XX%
- ROE:XX% | 毛利率:XX%
## 综合评分
- 技术面:⭐⭐⭐⭐☆ (4/5)
- 基本面:⭐⭐⭐☆☆ (3/5)
## 操作建议
[具体建议及风险提示]
Daily Stock Selection List Template
# 每日选股清单 [日期]
## 市场概览
- 上证指数:XXXX.XX(+X.XX%)
- 深证成指:XXXXX.XX(+X.XX%)
- 创业板指:XXXX.XX(+X.XX%)
## 热点板块 TOP5
1. [板块名称] +X.XX%
2. ...
## 精选个股
### 趋势突破型
| 代码 | 名称 | 现价 | 涨幅 | 突破形态 | 评分 |
|------|------|------|------|----------|------|
| ... | ... | ... | ... | ... | ... |
### 价值低估型
| 代码 | 名称 | 现价 | PE | PB | 评分 |
|------|------|------|-----|-----|------|
| ... | ... | ... | ... | ... | ... |
## 风险提示
投资有风险,以上分析仅供参考,不构成投资建议。
Key Scripts
scripts/fetch_market_data.py- Market data retrievalscripts/technical_analysis.py- Technical indicator calculation (outputs neutral strength/weakness descriptions, not buy/sell ratings)scripts/strategy_multi_factor.py- Multi-factor stock selection (including ST/suspended trading filtering)scripts/generate_report.py- Report generation (must be run within the scripts/ directory, depends on technical_analysis)
Reference Documentation
references/technical_indicators.md- Technical indicator calculation formulasreferences/candlestick_patterns.md- Candlestick pattern recognitionreferences/fundamental_metrics.md- Fundamental indicator descriptionsreferences/factor_library.md- Quantitative factor library
Acceptance Criteria (self-check before delivering each analysis)
- The end of the report contains the statement "For reference only, does not constitute investment advice" (the template already includes it; do not delete it)
- Data comes fromthis runakshare calls, with data timestamps and delays noted (may have a 15-minute delay)
- Technical/fundamental conclusions correspond one-to-one with the displayed indicator data; no judgments without data support
- What is given is "analysis + risk" rather than "buy/sell instructions": no expressions such as "full position", "bottom fishing", or "must rise"
- When a new strategy has not undergone historical backtesting, clearly mark it as "not backtested"
What Not to Do
- Do not predict tomorrow's rise or fall, and do not give definitive buy/sell price levels
- Do not make decisions for users, and do not recommend leverage operations beyond position sizing (template suggestion: single stock ≤20%)
- Do not analyze Hong Kong stocks/US stocks/cryptocurrencies (data sources and rules differ)
- When users emotionally press with "should I buy or not", reiterate the boundaries and provide a risk checklist, without giving instructions
Known Pitfalls
| Pitfall | Specific Manifestation | Response |
|---|---|---|
| akshare interface changes | After the library is updated, function names/fields change and the script reports errors | When an error occurs, first check the documentation for the current akshare version; do not guess fields blindly |
| Treating delayed data as real-time | Using prices from 15 minutes ago to discuss "current" | The report notes the data retrieval time |
| Piling up indicators without conclusions | Listing MACD/KDJ/RSI all at once but not explaining contradictions among them | When indicators conflict, clearly state "signal divergence" and its meaning |
| Survivorship bias in stock selection | Backtest historical strategies with the current constituent stocks | The backtest conclusion notes this limitation |
| Holiday/suspension data | Missing data for suspended stocks leads to calculation errors | Filter out suspended and ST abnormal statuses before calculation |
evals/routing-evals.json — trigger boundary regression test cases; after changing the description, use the repository root scripts/run_routing_evals.py to validate.