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-DD
bash
python scripts/analyze.py <Stock Code> --date YYYY-MM-DD

示例

Example

python scripts/analyze.py 600519 --date 2025-01-01
undefined
python scripts/analyze.py 600519 --date 2025-01-01
undefined

输入(必需)

Input (Required)

需要先运行
data-collect
,并确保
--date
一致。
output/<股票代码>/<日期>/data.json
Need to run
data-collect
first and ensure the
--date
is consistent.
output/<Stock Code>/<Date>/data.json

数据流

Data Flow

读取: output/<股票代码>/<日期>/data.json
输出: output/<股票代码>/<日期>/analysis.json
Read: output/<Stock Code>/<Date>/data.json
Output: output/<Stock Code>/<Date>/analysis.json

输出(稳定字段)

Output (Stable Fields)

  • trend
    :趋势状态、强度、是否偏多
  • bias
    :乖离率与安全性判断
  • macd
    :MACD 状态与信号
  • volume
    :量能状态
  • signal
    :动作建议、评分、理由与风险
  • trend
    : Trend status, strength, whether it is bullish
  • bias
    : Bias ratio and safety judgment
  • macd
    : MACD status and signal
  • volume
    : Volume status
  • signal
    : Action suggestion, score, reasons and risks

核心交易理念

Core Trading Philosophy

  1. 严进策略 - 乖离率 > 5% 坚决不买
  2. 趋势交易 - MA5 > MA10 > MA20 多头排列
  3. 买点偏好 - 缩量回踩 MA5/MA10 支撑
  1. Strict Entry Strategy - Never buy when the bias ratio > 5%
  2. Trend Trading - MA5 > MA10 > MA20 in a bullish arrangement
  3. 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
ScoreSignal
75+Strong Buy
60-74Buy
45-59Hold
30-44Wait and See
<30Sell
For detailed indicator explanations, see references/indicators.md

失败处理

Failure Handling

  • 找不到
    data.json
    :先运行
    data-collect
    (同一个
    --date
  • data.json
    字段缺失/为空:检查
    data-collect
    是否拉取成功;必要时扩大
    --days
  • 指标无法计算(样本不足):尝试提高
    data-collect --days
    (例如 120/240)
  • Cannot find
    data.json
    : Run
    data-collect
    first (with the same
    --date
    )
  • data.json
    fields are missing/empty: Check if
    data-collect
    pulled data successfully; expand
    --days
    if necessary
  • Indicators cannot be calculated (insufficient samples): Try increasing
    data-collect --days
    (e.g., 120/240)