Skip to content

Repository files navigation

存储股情报局 📊

memory-stock-daily

Automated daily intelligence for memory and semiconductor stocks. Every morning: DRAM/NAND/HBM prices, macro signals, IR updates → AI Chinese brief to Telegram.

English | 中文

What It Is

memory-stock-daily is an automated daily intelligence workflow for the memory and semiconductor supply chain. Every morning it collects market data, industry news, pricing signals, and company updates, then generates a structured Chinese brief and pushes it to Telegram.

What It Does

  1. Fetches market quotes — Futu OpenD first, with Yahoo Finance as fallback, covering MU / SNDK / NVDA / SOXX / SMH prices, volume, and moving averages.
  2. Aggregates industry news — TrendForce and Google News RSS for DRAM, NAND, HBM, macro commodities, and key memory stocks.
  3. Extracts signals — rule-based extraction for price hikes, shortages, demand upside, and supply-chain changes.
  4. Scores the day — five dimensions: market relative strength, DRAM/NAND pricing, HBM supply-demand, peer validation, and downstream demand.
  5. Generates a brief — MiniMax produces a structured Chinese report with risks, interpretation, and next-day watch points.
  6. Pushes to Telegram — sends the finished report to mobile, with plain-text fallback.

Quick Start

git clone https://github.com/<your-username>/memory-stock-daily.git
cd memory-stock-daily
pip install -r requirements.txt
cp .env.example .env
python main.py

Configuration

Variable Description
MINIMAX_API_KEY MiniMax API key for AI report generation
TELEGRAM_BOT_TOKEN Telegram bot token from BotFather
TELEGRAM_CHAT_ID Telegram chat ID for receiving reports
FUTU_HOST / FUTU_PORT Optional Futu OpenD host and port

Safety

Secrets should live in .env or GitHub Actions Secrets. Do not commit real API keys or Telegram tokens.

Disclaimer

This project is for personal research and learning only. It does not provide investment advice, trading recommendations, or financial guarantees.


这是什么

存储股情报局是一个全自动化的存储产业链日报系统。每天早上它会:

  1. 抓取行情 — 富途 OpenD(优先)或 Yahoo Finance(备选),获取 MU / SNDK / NVDA / SOXX / SMH 的价格、成交量、5日/20日均线
  2. 聚合新闻 — TrendForce、Google News RSS,覆盖 DRAM 合约价、NAND 行情、HBM 供需、宏观大宗(黄金/原油/美元)、重点存储股最新动态
  3. 提取信号 — 正则引擎从新闻标题/摘要中识别涨价、缺货、需求超预期等信号
  4. 量化评分 — 5 维度评分(行情强弱 / DRAM-NAND 价格 / HBM 供需 / 同行验证 / 下游需求),0–5 分
  5. 生成报告 — MiniMax 大模型输出结构化中文日报,包含风险信号、行情解读、明日观测点
  6. 推送 Telegram — 完整报告直达手机,备选纯文本格式兜底

效果预览

生成的日报节选:

【存储股日报|2026-05-07】

一、今日总判断
- 今日评分:4/5
- 状态:强正向
- 一句话解释:MU/SNDK 延续强势,DRAM/NAND 价格持续上行且 AI 需求强劲,
  但涨幅已大且 SNDK 今日小幅回调,需注意短期过热风险。

二、行情相对强弱
- MU:$651.80(+1.73%)| 5D +25.72% | 20D +60.25% |
  成交量 3730万(5日均 4460万 / 20日均 4010万)
...

项目结构

memory-watch/
├── main.py                      # 入口,每日调度
├── sources/
│   ├── futu_quotes.py           # 富途行情(需 OpenD)
│   ├── macro_quotes.py           # 黄金/原油/美元(yfinance)
│   ├── trendforce.py             # TrendForce + 高价值媒体 RSS
│   ├── news.py                   # 通用新闻 / 重点股票动态
│   ├── key_stock_analyzer.py     # 重点公司 IR 信号分析
│   └── price_signal_extractor.py # 正则价格信号提取
├── analysis/
│   ├── scoring.py                # 5 维度评分
│   └── signal_extractor.py       # 关键词信号提取
├── llm/
│   └── minimax_client.py         # MiniMax API 调用(重试+指数退避)
├── push/
│   └── telegram.py               # Telegram 推送
├── prompts/
│   └── daily_memory_report.md    # 日报生成 Prompt 模板
└── .github/
    └── workflows/
        └── daily-report.yml      # GitHub Actions 自动推送

快速启动

# 1. 克隆
git clone https://github.com/<your-username>/memory-watch.git
cd memory-watch

# 2. 安装依赖
pip install -r requirements.txt

# 3. 配置(复制模板,填入真实 Key)
cp .env.example .env
# 编辑 .env,填入:
#   MINIMAX_API_KEY=your_key
#   TELEGRAM_BOT_TOKEN=your_token
#   TELEGRAM_CHAT_ID=your_chat_id

# 4. 运行一次(富途 OpenD 可选,不开则自动走 Yahoo Finance)
python main.py

配置说明

变量 说明
MINIMAX_API_KEY MiniMax API Key,用于生成 AI 日报
TELEGRAM_BOT_TOKEN Telegram Bot Token,@BotFather 创建
TELEGRAM_CHAT_ID 接收推送的 Chat ID, @userinfobot 获取
FUTU_HOST / FUTU_PORT 富途 OpenD 地址(可选,不开则用 Yahoo Finance)

安全提示.env 文件已加入 .gitignore,不会提交到 GitHub。请勿将真实 Key 写入代码。

新闻时效与去重

  • 所有新闻强制 30 天时效过滤
  • 两层去重:URL 精确去重 + 标题 Bigram Jaccard 相似度(阈值 0.6)
  • Tom's Hardware 等高价值媒体已在 TrendForce Google News RSS 中覆盖,不重复抓取

评分维度

维度 满分 信号来源
行情相对强弱 1/1 5D/20D 超额收益 vs SOXX
DRAM / NAND 价格信号 1/1 合约价涨幅、现货价走势
HBM 供需信号 1/1 缺货报道、产能新闻
同行验证 1/1 Micron / SK hynix / Samsung / Nanya
下游需求 1/1 NVIDIA / 云厂商 CapEx / AI Server

自动化运行

方式一:GitHub Actions(推荐)

将代码推送到 GitHub 私有仓库后,在仓库 Settings → Secrets 添加以下密钥,Actions 会每天北京时间 8:30 自动运行:

Secret 来源
MINIMAX_API_KEY MiniMax Platform
TELEGRAM_BOT_TOKEN @BotFather
TELEGRAM_CHAT_ID @userinfobot

Secrets 路径:仓库 → Settings → Secrets and variables → Actions → New repository secret

也支持手动触发(workflow_dispatch),可指定任意日期测试。

方式二:macOS Crontab

crontab -e

# 每天早上 8:30 运行
30 8 * * * cd /path/to/memory-watch && /usr/bin/python3 main.py >> memory-watch.log 2>&1

免责声明

  • 本项目仅供个人学习研究,不构成任何投资建议
  • 代码不预测股价,不推荐买卖,不对任何投资收益负责
  • 生成内容来自公开新闻,准确性依赖数据源,不对内容负责

License

MIT

About

Automated daily intelligence for memory and semiconductor stocks. Aggregates DRAM/NAND/HBM prices, macro signals, and IR updates — AI-generated Chinese brief to Telegram every morning.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages