name: stock_bull_trend_analysis
description: Use this standalone stock strategy skill for 默认多头趋势 (bull_trend) 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/bull_trend.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/bull_trend/
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/bull_trend.yaml
- Strategy id:
bull_trend
- Display name: 默认多头趋势
- Category: trend
- Aliases: 趋势, 趋势分析, 多头趋势
- Required source tools: get_daily_history, analyze_trend
- 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/bull_trend/.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/bull_trend/prompts/, use the current Codex agent to generate the final analysis, and write that analysis to a Markdown file under ~/.stock_analysis/bull_trend/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/bull_trend/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/bull_trend/final_reports/<report>.md --base-report ~/.stock_analysis/bull_trend/reports/<base_report>.md
Strategy Rules
默认多头趋势(Default Bull Trend Strategy)
适用场景:
- 常规个股分析的默认策略。
- 优先寻找“趋势向上 + 风险可控 + 不追高”的机会。
分析框架:
-
趋势确认(优先级最高)
- 使用
analyze_trend 判断 MA5/MA10/MA20 排列。
- MA5 >= MA10 >= MA20 且 MA20 斜率向上,视为多头结构。
- 若价格显著跌破 MA20,则降低看多权重。
-
位置与节奏
- 优先“回踩不破”而非“高位追涨”。
- 当价格距离 MA5/MA10 过远时,提示等待回踩。
- 放量突破有效阻力时可提高胜率评级。
-
量价验证
- 使用
get_daily_history 检查突破日/反弹日是否放量。
- 缩量上涨需谨慎,放量滞涨需警惕分歧。
-
交易建议输出
- 输出明确的“买入/观望/减仓”倾向及触发条件。
- 必须给出止损参考(如 MA20 下方或结构低点)。
- 若无清晰优势,明确写“暂不出手”,避免过度交易。
评分调整建议:
- 多头排列 + 趋势强度良好:
sentiment_score +12
- 回踩关键均线后企稳:
sentiment_score +8
- 放量突破关键阻力:
sentiment_score +10
- 跌破 MA20 或趋势转弱:
sentiment_score -12
Guardrails
- Never print real API keys, passwords, webhook URLs, or tokens.
- Ask before overwriting an existing
~/.stock_analysis/bull_trend/.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/bull_trend/.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.