This is a free demo library with fixed messages for taking a look to paid library Alarmist.
Separate free demo library prepared, because the demo version of paid library would not work, since send functions do not work in tester.
Alarmist library for expert developers is a universal engine for sending messages to the Pushover and Telegram programs or by the functions SendNotification(), SendMail(). The possibility of using buttons in Telegram and sending to other messengers ( Twitter, Viber) and several specialized programs is being considered.
The message is also duplicated in the terminal by the Alert() function.
Advantages of the library:
- Mobile clients support for messages;
- Flexible and easy text formatting, html links, image, sound selection;
- Priorities, feedback;
- Text description of errors;
- Language Selection (EN, RU);
- Controllability (minimum sending period for each operator with a message);
- Durability (when sending to a channel fails, other channels are used);
- Addressing a message in the source code (file name and line number).
The library allows you to use html tags for formatting (bold, italics, underlined, color) and html links (templates are available to simplify formatting), image (jpg, png, gif was checked, including anigif), sound selection, priorities and buttons for feedback, where available. Where this is not available, advanced features will be ignored, tags, links, and carriage returns will be deleted. So you can create a single message for all channels, and it will be displayed adequately, in accordance with the available capabilities.
If the message cannot be delivered to the selected channel (sending failure), it will be sent to all other channels.
The message language can be selected (English or Russian). In case of errors in the terminal or the trading server, a text description of the error is displayed (in the selected language), in addition to the error code.
The message contains the address in the source code where send function was called.
There is a sending function with a minimum period limit for situations with too frequent events.
The recommended and most flexible channel is the Pushover program. It supports all the above features. At the highest priority 2 (Emergency), the message will be repeated with the specified period and timeout until the button is pressed in the client (the fact of pressing or timeout is determined in the library). Messages with priority 1 (High) are highlighted in red. Messages with priority 2 (Emergency) are highlighted with a deep red background.
Pushover for Android/iOS/PC uses the secure Push service to deliver messages. Its price is $5, you can download it at https://pushover.net/clients, there is a 7-day trial (I recommend starting it after downloading this library or demo library).
You should allow WebRequest for "https://api.pushover.net" and "https://api.telegram.org" URLs on "Expert Advisors" tab in terminal options.
The Comment tab has a a header file and an example script attached. In test script, you should initialize variables _pushoverUser, _pushoverToken, _telegramChannel and _telegramToken with values, taken from https://pushover.net and Telegram program.
Full description published.
I need your comments, reports, reviews and votes, they motivate further development. Welcome to Reviews and Comment tabs.
Many thanks to https://www.mql5.com/ru/users/sergeev for Json serialization/deserialization code and to https://www.mql5.com/ru/users/avoitenko for ideas of working with HTTP API.
Added: NOADDR macro.
Header file and test script attached.