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?
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.
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.
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?
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.