Skip to content

EthanAlgoX/AlphaRadar

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AlphaRadar

AlphaRadar is a TUI-first market intelligence terminal for US and HK equities.

It does not place trades. It collects market-relevant information, normalizes it into structured signals, maps signals to sectors and stocks, and lets you inspect the result from the terminal.

What It Does

  • Aggregates RSS news, macro feeds, and local knowledge rules into a single snapshot.
  • Normalizes multilingual and noisy source text into structured market events.
  • Builds two kinds of outputs:
    • signal -> stock
    • signal -> sector -> stocks
  • Tracks theme-specific snapshots for ai, semiconductors, cloud, biotech, and china-internet.
  • Supports source health, retry workflows, issue reason summaries, and cooldown for repeatedly failing sources.
  • Exposes everything through CLI and a curses-based TUI.

Current Scope

Implemented:

  • US and HK market snapshots
  • RSS feed catalog import from OPML
  • Official macro source catalog
  • Multi-platform domestic hotlist fetching via NewsNow API (e.g., Toutiao, Weibo, Bilibili)
  • Web search integrations for agents via Tavily, Bocha, and Anspire APIs
  • High priority tech & finance RSS profile matching (HackerNews, Yahoo Finance)
  • Theme-specific snapshot stores
  • Source health, issue classification, retry, and cooldown
  • TUI for signals, themes, and theme stores

Not implemented yet:

  • Real-time Reddit / X ingestion
  • Order execution
  • Backtesting
  • Web UI

Install

Requirements:

  • Python >= 3.11

Local editable install:

pip install -e .

Or run directly from source:

PYTHONPATH=src python -m alpharadar.cli.main --help

Project Layout

快速使用指南 (Quick Start)

AlphaRadar 的核心工作流可以分为:数据初始化 -> 同步刷新 -> 查看信号/大盘情绪

1. 启动体验 (使用内置数据)

# 生成基准快照
alpharadar ingest
# 查看提取的市场信号 (文本形式)
alpharadar signals
# 查看宏观新闻
alpharadar macro
# 查看聚焦股票 (包含交叉市场逻辑)
alpharadar watch --market US

2. 真实使用流程 (导入高质量信息源)

A. 导入 RSS 数据源 解析 OPML 格式的 RSS 订阅列表。比如你手边有 US 的书签:

alpharadar import-feeds /path/to/United\ States.opml --market US --region "United States"
# 支持带类型前缀的精细导入
alpharadar import-feeds /path/to/feeds.opml --market US --region "Global Tech" --category-prefix Tech

B. 启用内置的权威宏观数据源

alpharadar seed-macro-sources --market US
alpharadar seed-macro-sources --market HK
alpharadar list-macro-sources --market US

C. 数据源自动打分与过滤 基于内置的优质名单(覆盖 HackerNews, Yahoo Finance 等),系统帮你清理垃圾信息:

alpharadar score-feeds --market US
alpharadar autocurate-feeds --market US --threshold 0.5 --disable-others
alpharadar list-feeds --market US --curated-only

3. 生成真正的市场快照

当你订阅好信息源后,随时拉取最新信息,它会自动做清洗、提取信号:

# 拉取被启用的优质数据,并构建你专属的 US 市场全景快照
alpharadar refresh-market --market US --curated-only
alpharadar signals
alpharadar --lang zh signals
alpharadar signals --cross-market-only

(系统会自动记录上一次拉取的 Primary Market,诸如 signals, watch, macro 等命令会自动跟随此偏好;所有 CLI 命令支持 --lang en|zh。)

🎛 终端 UI (TUI) 沉浸式分析

每次刷新好快照后,按以下命令进入终端可视化大屏:

alpharadar tui
alpharadar --lang zh tui

TUI 核心快捷键:

  • 0-9: 在全局市场视角与各垂直主题(如 ai、芯片等)之间快速切换。
  • a / u / h: 快速筛选查看 全部(All) / 美股(US) / 港股(HK)。
  • x: 开启跨市场视角(比如在美股版块中,探求同步关联的港股异动信号)。
  • l: 在英文 / 中文显示之间切换。
  • s: 唤起侧滑的 Theme-store 浏览器。
  • n / o / t / e: 对侧边栏数据库进行状态筛选(全部 / 健康 / 过期 / 错误)。
  • Enter: 潜入选中的数据库。
  • g: 一键返回全局视角。
  • r: 重新从磁盘加载数据库。
  • j / k: 上下移动。
  • q: 退出。

高级分析:聚焦垂直主题 (Themes Workflow)

Theme stores 是独立的 SQLite 库,专门用于存放特定赛道(如 ai, semiconductors, cloud, biotech 等)的切片快照。

# 查看支持的所有主题
alpharadar themes

# 自动筛选并汇聚有关 AI 的专属数据库
alpharadar refresh-theme ai --market US --include-macro

# 终端纯净态查看主题切片
alpharadar theme-watch ai --market US --use-theme-store
alpharadar theme-status ai --market US

# 直接进入这块主题的专属 TUI 终端大屏
alpharadar theme-tui ai --market US

Source Operations

Feed catalog

List feeds:

alpharadar list-feeds --market US
alpharadar list-feeds --market US --curated-only
alpharadar list-feeds --market US --enabled-only --include-cooling

Manually change feed state:

alpharadar set-feed techcrunch --enable --priority 2.0
alpharadar set-feed cnn --disable

Fetch RSS without rebuilding the snapshot:

alpharadar fetch-feeds --market US --curated-only --market-signal-only

Macro source catalog

List macro sources:

alpharadar list-macro-sources --market US
alpharadar list-macro-sources --market US --enabled-only --include-cooling

Fetch macro feeds without rebuilding the snapshot:

alpharadar fetch-macro --market US

Health, Retry, and Cooldown

AlphaRadar tracks:

  • last_fetch_status
  • last_fetch_error
  • consecutive_failures
  • cooldown_until
  • cooldown_reason

After repeated failures, a source enters cooldown and is skipped by default during refresh/fetch. Use --include-cooling to inspect or explicitly include those sources.

Health views:

alpharadar feed-health --market US
alpharadar macro-health --market US
alpharadar list-theme-stores --status stale
alpharadar theme-status ai --market US

Retry failed theme sources:

alpharadar retry-theme-sources ai --market US --dry-run
alpharadar retry-theme-sources ai --market US --dry-run --rss-only --limit-targets 2
alpharadar retry-theme-sources ai --market US --dry-run --rss-only --reason-contains 403
alpharadar retry-theme-sources ai --market US --macro-only --reason-contains timeout
alpharadar retry-theme-sources ai --market US

retry-theme-sources supports:

  • --rss-only
  • --macro-only
  • --limit-targets
  • --reason-contains
  • --retry-status error|empty

TUI

Open the global TUI:

alpharadar tui
alpharadar --lang zh tui

Open a theme-specific TUI:

alpharadar theme-tui ai --market US

Main controls:

  • 0-9: switch between global view and theme views
  • a / u / h: filter by ALL / US / HK
  • x: show cross-market signals relative to the active global snapshot's primary market
  • l: switch display language between English and Chinese
  • s: open the theme-store browser
  • n / o / t / e: filter theme stores by all / ok / stale / error
  • enter: open the selected theme store
  • g: return to the global snapshot
  • r: reload the active store from disk
  • j / k: move selection
  • q: quit

The theme-store view shows:

  • snapshot status
  • signal and event counts
  • RSS and macro message counts
  • issue counts and issue reasons
  • per-source issue summaries

CLI Reference

Core analysis:

  • ingest
  • signals
    • --include-cross-market
    • --cross-market-only
  • explain
  • macro
  • watch
    • --include-cross-market
    • --cross-market-only
  • themes
  • theme-watch
  • tui
  • theme-tui

Global options:

  • --store
  • --lang en|zh

Catalog management:

  • import-feeds
  • list-feeds
  • score-feeds
  • set-feed
  • autocurate-feeds
  • seed-macro-sources
  • list-macro-sources

Fetching and snapshot rebuild:

  • fetch-feeds
  • fetch-macro
  • build-from-feeds
  • build-from-all
  • refresh-rss
  • refresh-market
  • refresh-theme

Health and maintenance:

  • feed-health
  • macro-health
  • list-theme-stores
  • theme-status
  • retry-theme-sources

Development

Run tests:

PYTHONPATH=src python -m unittest discover -s tests -v

Compile check:

python -m py_compile $(find src -name '*.py' -print)

Notes

  • The project is still MVP-stage and rule-heavy by design.
  • Theme stores are isolated from the global snapshot on purpose.
  • Source issue summaries and cooldown are meant to reduce repeated fetch noise, not permanently disable sources.
  • Most operational state lives in local SQLite files under .alpharadar/.

About

No description, website, or topics provided.

Resources

License

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages