Skip to content

Alerts

ClearEdge can push Telegram alerts for trading sessions — so you don’t have to watch a screen. Alerts are entirely optional: if unconfigured, the alert relay simply idles and nothing breaks.

Add two settings (in backend/.env or the Settings page — see configuration):

  • ATS_TELEGRAM_BOT_TOKEN — a Telegram bot token (from BotFather).
  • ATS_TELEGRAM_CHAT_ID — the chat id to send to.

The alert relay (ats/alerts/relay.py) watches a running session’s telemetry and sends a message on meaningful events, including:

  • Drawdown — when a session’s balance falls ATS_ALERT_DRAWDOWN_PCT (default 5%) below its peak.
  • Session lifecycle / gateway — significant state changes (e.g. a gateway going from healthy to broken is surfaced by the gateway monitor).

The relay is driven by the same Redis telemetry stream the UI reads, so alerts reflect exactly what the session reports. It runs alongside the paper/live runner; no extra process to manage.