technical-analysis
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese技术分析
Technical Analysis
基于 K 线数据进行完整技术分析,输出趋势判断和买卖信号。
Perform comprehensive technical analysis based on K-line data, output trend judgments and trading signals.
执行
Execution
bash
python scripts/analyze.py <股票代码> --date YYYY-MM-DDbash
python scripts/analyze.py <Stock Code> --date YYYY-MM-DD示例
Example
python scripts/analyze.py 600519 --date 2025-01-01
undefinedpython scripts/analyze.py 600519 --date 2025-01-01
undefined输入(必需)
Input (Required)
需要先运行 ,并确保 一致。
data-collect--dateoutput/<股票代码>/<日期>/data.jsonNeed to run first and ensure the is consistent.
data-collect--dateoutput/<Stock Code>/<Date>/data.json数据流
Data Flow
读取: output/<股票代码>/<日期>/data.json
输出: output/<股票代码>/<日期>/analysis.jsonRead: output/<Stock Code>/<Date>/data.json
Output: output/<Stock Code>/<Date>/analysis.json输出(稳定字段)
Output (Stable Fields)
- :趋势状态、强度、是否偏多
trend - :乖离率与安全性判断
bias - :MACD 状态与信号
macd - :量能状态
volume - :动作建议、评分、理由与风险
signal
- : Trend status, strength, whether it is bullish
trend - : Bias ratio and safety judgment
bias - : MACD status and signal
macd - : Volume status
volume - : Action suggestion, score, reasons and risks
signal
核心交易理念
Core Trading Philosophy
- 严进策略 - 乖离率 > 5% 坚决不买
- 趋势交易 - MA5 > MA10 > MA20 多头排列
- 买点偏好 - 缩量回踩 MA5/MA10 支撑
- Strict Entry Strategy - Never buy when the bias ratio > 5%
- Trend Trading - MA5 > MA10 > MA20 in a bullish arrangement
- Buying Preference - Shrink volume pullback to MA5/MA10 support
输出
Output
json
{
"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": [...]}
}json
{
"trend": {"status": "Bullish Arrangement", "strength": 75, "is_bullish": true},
"bias": {"ma5": 0.30, "status": "Safe"},
"macd": {"status": "GOLDEN_CROSS", "signal": "Golden Cross, trend upward"},
"volume": {"status": "SHRINK_VOLUME_DOWN", "trend": "Shrink Volume Pullback"},
"signal": {"action": "Buy", "score": 72, "reasons": [...], "risks": [...]}
}评分标准
Scoring Criteria
| 分数 | 信号 |
|---|---|
| 75+ | 强烈买入 |
| 60-74 | 买入 |
| 45-59 | 持有 |
| 30-44 | 观望 |
| <30 | 卖出 |
详细指标说明见 references/indicators.md
| Score | Signal |
|---|---|
| 75+ | Strong Buy |
| 60-74 | Buy |
| 45-59 | Hold |
| 30-44 | Wait and See |
| <30 | Sell |
For detailed indicator explanations, see references/indicators.md
失败处理
Failure Handling
- 找不到 :先运行
data.json(同一个data-collect)--date - 字段缺失/为空:检查
data.json是否拉取成功;必要时扩大data-collect--days - 指标无法计算(样本不足):尝试提高 (例如 120/240)
data-collect --days
- Cannot find : Run
data.jsonfirst (with the samedata-collect)--date - fields are missing/empty: Check if
data.jsonpulled data successfully; expanddata-collectif necessary--days - Indicators cannot be calculated (insufficient samples): Try increasing (e.g., 120/240)
data-collect --days