Advertisement IC Markets

Alert Bots: Sending Trading Alerts to Telegram or Discord

Share, develop, and backtest custom MQL4/MQL5 Expert Advisors, Python data-scraping scripts, trading bots, and automated market alert systems.
Post Reply
FXS Prop Desk
Posts: 1689
Joined: Wed Oct 07, 2026 9:52 am

Alert Bots: Sending Trading Alerts to Telegram or Discord

Post by FXS Prop Desk »

Bots can send alerts from MT5 or Python scripts to Telegram or Discord, so you can monitor setups or EAs remotely.

Telegram example (Python):

Code: Select all

import requests
def send(msg):
    requests.post(f"https://api.telegram.org/bot{TOKEN}/sendMessage",
                  data={"chat_id": CHAT_ID, "text": msg})
Uses:
  • Setup alerts when price reaches a level.
  • Fill notifications from EAs.
  • Daily summaries of trades and equity.
  • Error alerts.
Security tips: keep tokens out of shared code, and do not allow trading commands without authentication.

MQL5 can also send web requests directly using WebRequest (after allowing the URL in settings).

Rate limits are worth knowing: Telegram and Discord restrict how many messages a bot can send per second. Grouping alerts into one message during busy periods prevents lost notifications.

Do you use alert bots, and which platform do you send them to?
FXS Official Team | The Idea Lab & Strategy
Recommended broker for automated trading & scalping IC Markets
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

Re: Alert Bots: Sending Trading Alerts to Telegram or Discord

Post by Shadow Trader »

One practical thing worth knowing before wiring this into anything that trades: a plain requests.post call without a timeout can block forever. If Telegram is slow and the alert sits inside the same loop that manages your stops, the alert can delay the thing it was meant to report.

I always pass a timeout of a few seconds and push messages onto a queue that a separate thread sends. The trading loop just drops the text in and moves on, and if the send fails it gets retried without holding anything up.

On the MQL5 side, WebRequest is synchronous and can't be called from an indicator, only from an EA or a script. So an alert built into an indicator needs a different route, usually writing to a file that a small Python process watches.

On the rate limits, the rough numbers I work with are about one message per second to a single chat on Telegram, and a similar small burst limit per webhook on Discord. Batching fills into one message every 30 seconds keeps you well clear of both.

Which alerts have you actually found worth keeping? Mine shrank to fills, errors and the end of day summary within a month.
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

Re: Alert Bots: Sending Trading Alerts to Telegram or Discord

Post by Shadow Trader »

FXS Prop Desk, the security tip about blocking trading commands is the line I would put above the code sample. My bots can only send text. They cannot place, modify or close anything, and the token lives in an env file the trading process cannot read.

Telegram won for me over Discord for fills and errors because the mobile push is faster on my phone. Discord keeps the end of day summary only, in a private channel I read after the session.

I dropped level alerts within two weeks. They fired all session and trained me to ignore the phone, which defeated the fills and error channel.

Batching still sits at one message every 30 seconds during busy London. Single fill spam was how I hit the chat limit on a news morning and lost the error that mattered.

Which platform do you trust for the error path when the VPS itself is under load? That is the case where a blocked requests call without a queue hurt me once.
Shadow Trader
Posts: 5594
Joined: Wed Sep 09, 2026 5:19 pm

Re: Alert Bots: Sending Trading Alerts to Telegram or Discord

Post by Shadow Trader »

Constant chart-watching is exhausting and rarely productive. Alerts provide an alternative.

A price alert at a key level, a spread alert when cost exceeds a limit and a volatility alert when ATR crosses a threshold turn attention into a resource that can be spent wisely.

Most platforms support push notifications to a phone, which lets a trader step away from the desk. Sound alerts on the desktop provide another option.

The benefits go beyond comfort. Reduced screen time lowers fatigue and reduces impulsive trades triggered by every flicker.

An alert strategy also forces clarity. Setting an alert requires deciding in advance which levels matter, which is a form of planning.

Over-alerting defeats the purpose. Ten alerts per hour become background noise. Two or three meaningful ones per session work better.

Reviewing which alerts actually led to taken trades, and deleting the rest every month, keeps the system clean and meaningful instead of cluttered with stale levels.

How are alerts used here, and has reducing screen time affected results?
Amanhasnoname
Posts: 2060
Joined: Fri Oct 30, 2026 9:45 am

Re: Alert Bots: Sending Trading Alerts to Telegram or Discord

Post by Amanhasnoname »

I've been running a Telegram bot from my MT5 EAs for about a year, and it's one of the few tools I'd struggle to give up now. Mine sends a message on every fill and close with the pair, size and price, plus an alert if the EA hasn't sent a heartbeat for fifteen minutes. That last one caught a frozen VPS twice before it cost me anything.

The early version was far too noisy. I had alerts for every level touch and every signal check, and within a week I was ignoring my phone completely, which defeats the point. Cutting it down to fills, errors and a short evening summary made me actually read each message again.

On the security side, I keep the bot token in a separate config file outside the EA folder and the bot only sends, it never accepts commands. It's tempting to add a close-all button from the phone, but I'd rather log in to the app properly than risk a mistake there.
Post Reply