A push notification to your phone is the simplest way to know what an Expert Advisor is doing while you are away from the terminal. MQL5 has one function for it, SendNotification(), and most EAs call it directly wherever something interesting happens.
That works until the day something goes wrong. A disconnect, a loop of rejected orders or a burst of partial fills makes the EA call SendNotification() many times in a few seconds. The terminal has strict limits on this function, and if they are broken it can disable notifications for the program. So the one moment you most need the alert is the moment it stops arriving.
This tutorial builds a small notifier that respects the limits, skips duplicates and still logs everything.
The rules from the documentation
The message can be at most 255 characters.
No more than 2 calls per second and no more than 10 calls per minute.…