v0.2 · 开源 Fintech · Python · Telegram Open Source · Python · Telegram

作者 Shijie Zheng · 正版源码 GitHub by Shijie Zheng · official source GitHub

均线监控告警 Bot
不用盯盘,条件到了手机响
MA Monitor & Alert Bot
Stop watching charts — get pinged

基于 Python asyncio 的实时行情监控:检测 4H / 1D / 1W 均线密集与 200MA 触碰, Telegram 即时推送;可选 TradingAgents 多智能体 AI 深度解读。 Asyncio market monitor: MA cluster & 200MA touch on 4H / 1D / 1W, instant Telegram alerts, optional TradingAgents AI deep-dive.

13 监控标的 Symbols
~37 活跃监控组合 Active monitors
2 告警类型 Alert types
AI TradingAgents 可选 Optional AI
Telegram alerts and status demo
Telegram:告警推送 · /status 摘要 · AI 报告附件 Telegram: alerts · /status · AI report attachment

核心功能 Core Features

规则引擎决定「何时告警」,AI 可选解读「意味着什么」—— 纯后端进程,无 Web API。 Rules decide when to alert; optional AI interprets what it might mean — single Python process, no web API.

📊

均线密集告警 MA Cluster Alert

20/60/120 的 MA + EMA(6 线),4H / 1D / 1W,spread ≤ 0.8% 6 lines (20/60/120 MA & EMA), 4H / 1D / 1W, spread ≤ 0.8%

🎯

200MA 触碰告警 200MA Touch Alert

仅 1D / 1W,距 200MA ≤ 1.2%;4H 不做触底,不看 200EMA 1D / 1W only, ≤ 1.2% from 200MA; no 4H touch, no 200EMA

🧠

AI 深度解读 AI Deep-Dive

告警后自动 / 手动 /analyze,TradingAgents 生成 HTML 报告推送到 Telegram Auto or /analyze: TradingAgents report → Telegram summary + HTML

Binance 实时 Binance Real-time

U 本位合约 WebSocket aggTrade + K 线闭合,低延迟触碰检测 USDT-M futures WebSocket aggTrade + closed klines

📈

美股 / 黄金 Equities & Gold

Yahoo Finance 历史 K 线 + 轮询,覆盖 MSTR、NVDA、GC=F 等 Yahoo Finance bars + polling for MSTR, NVDA, GC=F, etc.

🛡️

冷却 & 防抖 Cooldown & Debounce

同一标的+周期+类型 4h 冷却,60s 防抖,避免消息轰炸 4h cooldown + 60s debounce per symbol × interval × type

数据流 Data Flow

config.yaml 决定监控标的与阈值;providers 拉行情,services 算指标,notifiers 推 Telegram。 config.yaml drives watchlist & thresholds; providers fetch, services compute, notifiers push.

config.yaml 标的 · 周期 · 阈值 Symbols · intervals · thresholds
Providers Binance WS/REST · Yahoo Binance WS/REST · Yahoo
Engine MA/EMA · 密集 · 触碰 MA/EMA · cluster · touch
Telegram 告警 · /status Alerts · /status
AI (opt.) TradingAgents 报告 TradingAgents report

效果演示 Live Demo

以下为实际运行截图,展示 Telegram 交互与 AI HTML 报告。 Screenshots from a running instance — Telegram UX & AI HTML report.

Telegram status and alerts
Telegram:监控状态 /status、告警推送、HTML 报告附件 Telegram: /status, alert push, HTML report attachment
TradingAgents AI analysis report
TradingAgents AI 深度解读(MSTR 示例) TradingAgents AI deep-dive (MSTR example)

当前监控标的 Current Watchlist

来自 config.yaml,每个标的在 4H / 1D / 1W 独立监控。 From config.yaml — each symbol monitored on 4H / 1D / 1W.

标的 Symbol 数据源 Source 周期 Intervals 说明 Notes
BTC/USDT Binance Futures 4H · 1D · 1W WebSocket 实时 WebSocket real-time
ETH/USDT Binance Futures 4H · 1D · 1W WebSocket 实时 WebSocket real-time
SOL · BNB · HYPE Binance Futures 4H · 1D · 1W /USDT
MSTR · NVDA · MSFT · GOOGL Yahoo Finance 4H · 1D · 1W 轮询 ~5min Polled ~5min
QQQ · VOO · CRCL Yahoo Finance 4H · 1D · 1W ETF / Equity
XAU (GC=F) Yahoo Finance 4H · 1D · 1W COMEX 黄金期货 COMEX gold futures

技术栈 Tech Stack

单进程 asyncio,Docker 可部署,适合作为 fintech / Web3 作品集参考项目。 Single-process asyncio, Docker-ready — great fintech / Web3 portfolio piece.

Python 3.12+ asyncio Pandas Binance WebSocket Yahoo Finance Telegram Bot API TradingAgents DeepSeek / OpenAI uv Docker

引用本项目 Cite this project

视频、文章、简历中请链回官方 GitHub,并保留作者署名(Apache-2.0)。 Link to the official GitHub repo and keep attribution (Apache-2.0).

Invest Alert Bot — MA monitor & Telegram alerts
Author: Shijie Zheng (Kerry Zheng)
https://github.com/Formyselfonly/invest-alert-bot
Live demo: https://formyselfonly.github.io/invest-alert-bot/
License: Apache-2.0