Perform complete technical analysis based on K-line data, and output trend judgments and buy/sell signals.
Execution
python scripts/analyze.py <股票代码> --date YYYY-MM-DD
# 示例
python scripts/analyze.py 600519 --date 2025-01-01
Input (required)
Need to first run data-collect, and ensure --date is consistent.
output/<股票代码>/<日期>/data.json
Data flow
读取: output/<股票代码>/<日期>/data.json
输出: output/<股票代码>/<日期>/analysis.json
Output (stable fields)
trend: trend status, strength, whether bullishbias: deviation rate and safety judgmentmacd: MACD status and signalsvolume: volume statussignal: action recommendation, score, reasons, and risks
Core trading philosophy
- Strict entry strategy - Absolutely do not buy if deviation rate > 5%
- Trend trading - MA5 > MA10 > MA20 bullish alignment
- Buy point preference - Pullback on reduced volume to MA5/MA10 support
Output
{
"trend": {"status": "多头排列", "strength": 75, "is_bullish": true},
"bias": {"ma5": 0.30, "status": "安全"},
"macd": {"status": "GOLDEN_CROSS", "signal": "金叉,趋势向上"},
"volume": {"status": "SHRINK_VOLUME_DOWN", "trend": "缩量回调"},
"signal": {"action": "买入", "score": 72, "reasons": [...], "risks": [...]}
}
Scoring criteria
| Score | Signal |
|---|---|
| 75+ | Strong Buy |
| 60-74 | Buy |
| 45-59 | Hold |
| 30-44 | Wait and see |
| <30 | Sell |
For detailed indicator descriptions, see references/indicators.md
Failure handling
- Cannot find
data.json: first rundata-collect(the same--date) data.jsonfield missing/empty: check whetherdata-collectwas fetched successfully; if necessary, expand--days- Indicators cannot be calculated (insufficient samples): try increasing
data-collect --days(for example 120/240)