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)
🔥 当前 19 位定制用户在服 · VIP 16/50 · 高级 VIP 3/10 🔥 19 active custom users · VIP 16/50 · Premium VIP 3/10

私人定制版 — 比开源版省心十倍 Private Custom Edition — 10× less hassle

开源版适合自己动手;定制版由作者专属部署、调参、运维, 7×24 监控你的标的,Telegram 到了条件立刻响 — 你只管交易决策,不用盯配置和服务器。 你的监控清单、阈值与交易思路仅属于你,不会出现在公开展示页,也不会对外泄露。 The open-source repo is DIY-friendly; the custom edition is deployed, tuned, and maintained for you — 24/7 monitoring with zero server babysitting. Your watchlist, thresholds, and trading approach stay private — never on the public demo site, never shared.

私人定制 · 隐私优先 Private custom · Privacy first

  • 独立实例 — 每位定制用户单独 Bot + 单独配置,告警只推送到你的 Telegram Dedicated instance — separate bot & config per client; alerts only to your Telegram
  • 策略保密 — 你监控什么标的、用什么阈值/周期,属于个人交易方法,作者不公开、不分享、不用于案例宣传 Strategy confidentiality — your symbols, intervals & thresholds are your edge; we do not publish, share, or use them in marketing
  • 与开源演示隔离 — 网站公开展示的是默认 demo 数据;不会把 VIP 用户的私有标的或参数放上 GitHub Pages Separate from public demo — the website shows default demo data only; never your private watchlist on GitHub Pages
  • 凭证隔离 — Telegram Token、API Key、.env 仅用于你的实例运维,不写入公开仓库 Credential isolation — tokens & keys used only for your instance; never committed to public repos

开源版(免费) Open source (free)

  • 自己 clone、配 .env、买 VPS、Docker Clone, configure .env, VPS, Docker yourself
  • 默认 13 标的 & 固定阈值 Default 13-symbol watchlist & thresholds
  • GitHub Issues 社区支持 Community support via GitHub Issues

私人定制版(付费) Private custom (paid)

  • 作者代部署 + 7×24 运维,开机即用 Author deploys & maintains 24/7 — ready to go
  • 你的标的、你的阈值、你的 Telegram — 策略不对外公开 Your symbols, thresholds & Telegram — strategy stays private
  • 优先响应 + 按需加功能 Priority support & on-demand features
VIP 定制 VIP Custom
$20 / 月 / month
定制用户 Custom users 16 / 50

还剩 34 个名额 34 slots left

个人交易者首选 — 专属 Bot,不用自己运维 For individual traders — your own bot, zero ops

  • ✅ 独立 Telegram Bot 实例(仅你的 chat_id,策略不共享) ✅ Dedicated Telegram bot (your chat_id only — no shared strategy)
  • ✅ 自定义监控标的 & 周期(加密 + 美股 + 黄金) ✅ Custom watchlist & intervals (crypto, equities, gold)
  • ✅ 密集 / 200MA 阈值按需调整 ✅ Tunable cluster & 200MA thresholds
  • ✅ 作者协助 VPS Docker 部署 & 日常维护 ✅ VPS Docker setup & ongoing maintenance
  • ✅ Binance WebSocket 实时 + Yahoo 轮询 ✅ Binance WebSocket + Yahoo polling
  • ✅ 优先技术支持(48h 内响应) ✅ Priority support (within 48h)
  • ✅ 监控清单与阈值保密,不进入公开展示页 ✅ Watchlist & thresholds kept confidential — off the public site
申请 VIP 定制 Apply for VIP

💡 上方数字为当前在服定制用户数 / 该档位总名额(VIP 50 位、高级 VIP 10 位,互不占用)。 私人定制强调隐私与策略保密:你的标的、阈值与告警逻辑不会公开或用于宣传。 开源代码永久免费(Apache-2.0);付费定制的是部署、运维、个性化与支持,不是卖源码。不构成投资建议。 💡 Figures show active custom users / tier capacity (VIP 50, Premium VIP 10 — separate pools). Private custom means privacy & strategy confidentiality — your watchlist and rules are never published or used for marketing. Source code stays free (Apache-2.0); you pay for deployment, ops, personalization & support — not the code. Not financial advice.

当前监控标的 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

本项目采用 Apache-2.0。请链回官方 GitHub、保留作者署名。 允许学习研究与个人部署体验;盈利、二次开发、改写后对外发布须事先联系作者同意 Licensed under Apache-2.0. Link to the official repo and keep attribution. Study & personal non-commercial deploy are welcome; commercial use, derivatives, or public rewrites require author consent.

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

使用范围(作者说明) Scope of use (author policy)

允许Allowed

  • 学习、研究、阅读源码Study & research
  • 个人部署体验(非商用)Personal non-commercial deploy
  • 引用时署名 + 链回官方仓库Cite with attribution + official link

⚠️ 需作者同意Author consent required

  • 商业盈利、收费服务Commercial / paid services
  • 二次开发后公开发布Public secondary development
  • 改写后对外提供 Bot / SaaSRewritten bot or SaaS for others

禁止Not allowed

  • 删除 LICENSE / NOTICE / 署名Remove LICENSE / NOTICE / attribution
  • 去署名后宣称原创Claim as your original work
  • 冒充官方或误导来源Impersonate official source

商用或二次开发授权: GitHub Issues 联系作者 · 法律层面以 Apache-2.0 为准 Commercial / derivative licensing: contact via GitHub Issues · Legally governed by Apache-2.0