Commit Graph

566 Commits

Author SHA1 Message Date
Alfred
648bf5b638 fix: 标普500实时数据缺失(美股指数: SPX/DJI/IXIC 等) (Issue #273) (#344)
* fix: SPX and other US indices real-time/daily data support (Issue #273)

- Add us_index_mapping module for SPX/DJI/IXIC/NDX/VIX/RUT mapping
- Route US index requests directly to YfinanceFetcher
- Deduplicate US stock code detection via is_us_stock_code()
- Fast-path get_daily_data for US indices/stocks to avoid redundant fetcher attempts
- Add unit tests for us_index_mapping

* docs: sync README, CHANGELOG, full-guide for Issue #273
2026-02-18 11:56:25 +08:00
Alfred
7cf1925179 增加 PE 指标、新闻时效性筛查与强势趋势股乖离率放宽 (fix #296) (#340)
* feat: add PE valuation guidance, news freshness, and strong-trend bias relief (Issue #296)

- NEWS_MAX_AGE_DAYS: configurable news max age (default 3 days)
- BIAS_THRESHOLD: configurable MA5 bias threshold (default 5.0%)
- Strong trend compensation: relax bias threshold 1.5x for STRONG_BULL with strength>=70
- AI system prompt: add PE valuation focus and strong-trend relief guidance
- SearchService: pass days param to search_comprehensive_intel
- Config/pipeline robustness: boundary clamping, NaN defense

* test: add unit tests for Issue #296 (bias relief, news freshness)
2026-02-16 20:16:35 +08:00
mumu
498770616f feat(ci): harden smoke gates and automated release pipeline #minor (#336)
- add scripts/ci_gate.sh as unified backend gate entry

- restructure CI into backend-gate/docker-build/web-gate with frontend path detection

- add network-smoke non-blocking workflow for scheduled/manual network checks

- harden docker-publish with tag/manual release_tag flow, semver + changelog validation, and pre-publish docker smoke

- expand PR review and AI review coverage to code/docs/config/workflow changes

- align PR template and contributor docs with AGENTS.md review requirements

- add pytest markers and python-multipart dependency; restore test setup in get_latest_data tests
2026-02-15 23:05:56 +08:00
Alfred
5414a6de80 feat: add REPORT_SUMMARY_ONLY option for analysis summary only (Fixes #262) (#331)
- Add report_summary_only config (env: REPORT_SUMMARY_ONLY, default false)
- When true, notification shows only summary block without per-stock details
- Applies to generate_dashboard_report, generate_wechat_dashboard, generate_daily_report
- Update README, full-guide, CHANGELOG, .env.example
- Register in Web UI config (config_registry, systemConfigI18n)
- No workflow change: GitHub Actions users can add REPORT_SUMMARY_ONLY via repo vars when needed
2026-02-15 19:13:36 +08:00
Alfred
542c8e4314 feat: merge stock and market report into one notification (Issue #190) (#330)
- Add MERGE_EMAIL_NOTIFICATION env var (default false) to control merged push
- When enabled, combine个股分析 and 大盘复盘 into single notification
- Reduces email count and spam detection risk
- Incompatible with SINGLE_STOCK_NOTIFY, merge disabled in single-stock mode
- Update README, .env.example, full-guide, CHANGELOG

Fixes #190
2026-02-15 19:11:58 +08:00
Alfred
b19a4d0df9 feat: 支持图片识别股票代码、Anthropic Claude API 及通达信手动配置 (fix #257) (#329)
* feat: Add image stock code extraction, Anthropic API, and Pytdx config (Fixes #257)

- Add POST /api/v1/stocks/extract-from-image with Vision LLM (Gemini/Anthropic/OpenAI)
- Add image_stock_extractor service with 60s timeout, rate limit (10/min), X-Forwarded-For support
- Add ImageStockExtractor UI in Settings for upload and merge-to-watchlist
- Add ANTHROPIC_API_KEY, ANTHROPIC_MODEL to config and analyzer fallback chain
- Add PYTDX_HOST, PYTDX_PORT, PYTDX_SERVERS for custom Pytdx server
- Add OPENAI_VISION_MODEL for image-only models
- Handle 409 conflict in merge flow with user-friendly message

* fix: resolve TypeScript build error in stocks.ts (avoid Record<> generic parsing)

* feat: Redis rate limiter, API field unification, anthropic_max_tokens

- Add rate_limiter.py: Memory + Redis implementations for extract-from-image
- Integrate get_extract_rate_limiter() in stocks.py; remove image param, keep file only
- Add anthropic_max_tokens config for analyzer
- Update .env.example, config_registry, full-guide, CHANGELOG
- Add redis>=5.0 as optional dependency

* refactor: rename GeminiAnalyzer to LLMAnalyzer for multi-backend clarity

* revert: restore GeminiAnalyzer naming (keep original upstream convention)

* docs: add image extraction and from-image-add usage to README

* fix: Anthropic runtime fallback to OpenAI; remove Redis rate limiter

- Init both Anthropic and OpenAI at startup so Anthropic 429/network glitch can fall back to OpenAI
- Check Anthropic before OpenAI in _call_api_with_retry to preserve priority
- Remove Redis rate limiter per review; keep in-memory only

* remove rate limiter for extract-from-image per review

- Delete rate_limiter.py; extract-from-image has no rate limiting
- Remove Request param and 429 response from stocks endpoint
- Update docs to drop rate limit mentions
2026-02-15 19:10:42 +08:00
Alfred
84a3da9953 feat: add WEBHOOK_VERIFY_SSL for self-signed cert support (#265) (#319)
- Add webhook_verify_ssl config (default true), parse WEBHOOK_VERIFY_SSL env
- Pass verify param to all Webhook requests (WeChat, Feishu, Discord, Custom, AstrBot)
- Add WEBHOOK_VERIFY_SSL to config_registry with security warning
- Update .env.example, README, full-guide, CHANGELOG

Closes #265
2026-02-14 22:00:55 +08:00
Alfred
5883dc41bd feat: add Markdown-to-image for notification channels (Fixes #289) (#315)
* feat: add Markdown-to-image for notification channels (Fixes #289)

- Add MARKDOWN_TO_IMAGE_CHANNELS config for telegram, wechat, custom, email
- New src/md2img.py: markdown_to_image() via imgkit/wkhtmltoimage
- Extract markdown_to_html_document to src/formatters.py for reuse
- Implement image sending: Telegram sendPhoto, WeChat base64+md5,
  Discord webhook multipart, email inline attachment
- Add imgkit to requirements, wkhtmltopdf to Dockerfile
- Graceful fallback to text when imgkit/wkhtmltopdf unavailable

* fix(docker): pin to bookworm for wkhtmltopdf, add runtime deps

wkhtmltopdf was removed from Debian testing (2025). Pin base image to
python:3.11-slim-bookworm. Add fontconfig, libjpeg62-turbo, libxrender1,
libxext6 for headless wkhtmltopdf.

* docs(md2img): add security note on command injection and XSS

* refactor(md2img): extract _should_use_image_for_channel, document Fallback rules

* docs: add Markdown-to-image dependency install guide (imgkit, wkhtmltopdf)
2026-02-13 21:16:22 +08:00
Alfred
184084e415 feat: stock-to-email group routing (Fix #268) (#313)
- Add STOCK_GROUP_N + EMAIL_GROUP_N config for routing reports to different emails
- Market review sends to all configured email receivers
- Minimal changes: optional params on send_to_email and send(), new helpers
2026-02-12 22:26:05 +08:00
mumu
8f30f9093d fix: report signal accuracy, data source reliability, and market revi… (#275)
* fix: report signal accuracy, data source reliability, and market review quality #patch

- Fix signal emoji mismatch for compound advice and *ST markdown escaping
- Inject structured data (indices/stats/sectors) into market review
- Fix tushare return type and API endpoint; auto-inject realtime priority
- Add search cache (500-cap FIFO), limit supplement requests to 1
- Fix analysis API report=None and ReportStrategy type inconsistency
- Update CHANGELOG for v3.0.1 ~ v3.0.5

* fix:  F821 undefined name 'UnifiedRealtimeQuote'
2026-02-08 18:21:33 +08:00
mumu
52917baa02 feat!: replace legacy WebUI with unified FastAPI architecture #major (#267)
* feat!: replace legacy WebUI with unified FastAPI architecture #major

- Remove legacy WebUI (web/ package based on ThreadingHTTPServer)
- Unify CLI commands: --webui now seamlessly launches the new FastAPI service
- Migrate task service from web/services.py to src/services/task_service.py
- Update documentation to reflect the new simplified usage

* refactor(service): support parameterized query source in TaskService
2026-02-06 22:06:01 +08:00
zhulinsen
231eccdc9c feat: enhance US stock support with multi-source fetchers #minor
- Implement US stock history fetching in AkshareFetcher
  - Implement US stock realtime quotes in YfinanceFetcher
  - Add US stock filter to unsupported fetchers (Baostock, Tushare, etc.) to trigger fallback
  - Optimize realtime quote fallback strategy to prioritize Yfinance for US stocks
  fixes #153
  # minor
2026-02-01 11:52:27 +08:00
zhulinsen
ea3ce3c803 docs: update README and CHANGELOG for v2.1.6
- Add Pytdx (通达信) to data sources list
  - Add multi-source stock name resolution feature
  - Add enhanced search fallback feature
  - Update roadmap with Pytdx data source
2026-01-29 22:44:14 +08:00
zhulinsen
07e1a4bfaa docs: update documentation for v2.1.0 features
- Add Discord notification channel to README, full-guide, and README_EN
  - Add MACD/RSI technical indicators to trading philosophy section
  - Simplify README config table, move advanced options to full-guide
  - Rewrite CHANGELOG v2.1.0 with complete feature list:
    - US stock support
    - MACD/RSI indicators
    - Discord push support
    - DingTalk bot command interaction
    - Data source failover mechanism
  - Add Discord configuration guide (Webhook + Bot API)
  - Add push behavior settings (SINGLE_STOCK_NOTIFY, REPORT_TYPE, ANALYSIS_DELAY)
2026-01-25 18:05:02 +08:00
zhulinsen
0541c6f408 fix: update CI paths and bump version to v2.1.0
- 🐛 CI: Fix python-m py_compile paths in workflow and test.sh
- 📝 Docs: Update Roadmap order in READMEs
- 🔖 Version: Update CHANGELOG to v2.1.0
2026-01-25 16:45:25 +08:00
zhulinsen
9f0871a774 refactor: project structure optimization and network stability (v1.7.0)
- 📦 Structure: Move core modules to src/, docs to docs/, docker configs to docker/
- 🔧 Config: Fix .env loading path and remove hardcoded proxy settings
- 🌐 Network: Implement smart proxy routing (auto NO_PROXY for domestic apis)
- 🛡️ Stability: Enhance EfinanceFetcher with robust retry logic for ProtocolErrors
- 📝 Docs: Update relative links in READMEs and update CHANGELOG to v1.7.0
2026-01-25 16:35:32 +08:00