name: stock_wave_theory_analysis
description: Use this standalone stock strategy skill for 波浪理论 (wave_theory) analysis. Accept one or more A-share stock codes, Chinese stock names, US stock tickers, or Hong Kong stock codes, collect market/news data, and produce a Codex-readable Markdown report focused on the 波浪理论 strategy. Source strategy: ~/daily_stock_analysis/strategies/wave_theory.yaml.
波浪理论 Stock Analysis Skill
This skill is a strategy-specific variant of stock_ai_analysis. It uses the same bundled analyzer structure. User config, generated prompts, reports, and final reports for this strategy live under:
~/.stock_analysis/wave_theory/
Downloaded market-data caches are shared across strategies under ~/.stock_analysis/cache/ so users do not need to fetch the same data repeatedly.
Strategy Source
- Source file:
~/daily_stock_analysis/strategies/wave_theory.yaml
- Strategy id:
wave_theory
- Display name: 波浪理论
- Category: framework
- Aliases: 波浪, 波浪理论, 艾略特
- Required source tools: get_daily_history, analyze_trend, get_realtime_quote
- Summary: 基于艾略特波浪理论的推动浪与调整浪结构,判断当前所处浪型与潜在目标价。
Workflow
- Work only inside this skill directory. Do not import, inspect, or depend on files outside it during normal analysis.
- The script creates and reads user config at
~/.stock_analysis/wave_theory/.env. Always run config check first:
python scripts/analyze.py --check-config
- First-run hard rule: if
--check-config shows CONFIG_CREATED: yes, explicitly tell the user initialization config is required before any analysis. Do not run --stocks in the same turn.
- Incomplete-config hard rule: if required capability keys are missing for the user request, stop and ask the user to complete configuration using
references/configuration.md before running analysis. Never run partial/incomplete analysis.
- Ask for stock codes, names, or tickers if not supplied. Accept
600487, 北方华创, AAPL, 00700.HK, or mixed input like 北方华创,600487,AAPL,00700.HK.
- Only after configuration is complete, run analysis:
python scripts/analyze.py --stocks <codes>
Use --no-llm for data-only smoke runs.
Use --send-email only after the user confirms email delivery.
Use --no-email for validation runs when EMAIL_ENABLED=true.
- Open the latest prompt files under
~/.stock_analysis/wave_theory/prompts/, use the current Codex agent to generate the final analysis, and write that analysis to a Markdown file under ~/.stock_analysis/wave_theory/final_reports/.
- The final analysis must apply the strategy rules below. Do not return a generic stock report when this skill is invoked.
- Send email only from a finalized current-agent report:
python scripts/analyze.py --send-final-report ~/.stock_analysis/wave_theory/final_reports/<report>.md
If a generated base report exists, merge the final analysis back into the original report before sending:
python scripts/analyze.py --send-final-report ~/.stock_analysis/wave_theory/final_reports/<report>.md --base-report ~/.stock_analysis/wave_theory/reports/<base_report>.md
Strategy Rules
波浪理论(Elliott Wave Theory)
核心原则:市场按照 5 浪推进 + 3 浪调整的循环结构运行。
分析步骤
1. 识别当前浪型
使用 get_daily_history 获取近 120 日数据,结合 analyze_trend 趋势数据:
推动浪(1-3-5)识别特征:
- 第1浪:趋势反转的第一波,成交量温和放大。
- 第3浪:最强劲的推动浪,通常放大量,MACD 强势;绝不是最短浪。
- 第5浪:量能往往弱于第3浪,出现顶背离则走高后即将结束。
调整浪(A-B-C)识别特征:
- A 浪:第一次下跌,成交量较大,多数人以为是回调。
- B 浪:反弹,力度弱于前期涨幅,成交量萎缩,陷阱风险高。
- C 浪:第二次下跌,力度往往超过 A 浪,完成调整。
2. 黄金位置判断
- 第2浪回调通常在第1浪的 38.2%~61.8%。
- 第3浪目标通常是第1浪的 1.618~2.618 倍延伸。
- 第4浪不得进入第1浪价格区域(违反波浪规则)。
- C浪目标:A 浪顶端起算,等于或超过 A 浪长度。
3. 最优买点
- 第2浪回调企稳(黄金坑):最安全买点,止损第1浪起点。
- 第4浪回调企稳:次优,止损第1浪顶部。
- 第3浪初期突破:放量突破第1浪高点时。
- 避免在第5浪末端追高(顶背离风险)。
4. 风险提示
- B浪反弹不宜重仓(陷阱性质)。
- 波浪计数存在主观性,需结合其他技术指标验证。
- 若波浪规则被违反(如第4浪侵入第1浪),需重新归数。
5. 输出要求
- 给出当前可能的浪型位置(如:"处于第3浪中段"或"疑似第4浪调整")。
- 给出关键斐波那契支撑/阻力位(0.382/0.618/1.618)。
- 说明当前是买入时机、等待机会还是规避。
- 标注波浪计数的置信度(高/中/低)。
评分调整建议:
- 第2浪底部企稳(黄金坑):
sentiment_score +15
- 第3浪突破确认:
sentiment_score +12
- 第5浪末端/顶背离:
sentiment_score -10
- C浪下跌中:
sentiment_score -12
Guardrails
- Never print real API keys, passwords, webhook URLs, or tokens.
- Ask before overwriting an existing
~/.stock_analysis/wave_theory/.env value.
- Ask before sending email. Do not enable
EMAIL_ENABLED=true unless the user explicitly wants automatic delivery.
- Do not block the user on optional keys. Offer a skip path and explain the consequence.
- Required-capability keys are not optional. If missing, stop and ask for config instead of running degraded analysis.
- First run always requires an explicit initialization prompt to the user before analysis.
- Never run partial or incomplete functionality; this is mandatory.
- Explain failures by impact: blocking, fallback succeeded, or data-quality degradation.
- Do not call local Hermes or other local agent CLIs from this skill. The current Codex agent is responsible for reading generated prompt files and writing the final analysis.
- Reports and emails must contain the strategy analysis result, not raw prompt context.
Bundled Resources
scripts/analyze.py: deterministic entry point.
scripts/stock_agent/: self-contained helper functions for config, data, search, LLM, and report rendering.
scripts/stock_agent/data.py: strategy-local data extraction code that reuses the shared ~/.stock_analysis/cache/ directory to avoid duplicate downloads across strategies.
assets/env.example: template copied to ~/.stock_analysis/wave_theory/.env on first run.
requirements.txt: Python dependency list.
references/configuration.md: API-key setup details for this strategy folder.
references/reporting.md: report and interface-status interpretation.