To use the library, place the file in the correct MetaTrader directory. Open MetaTrader. Go to > Open Data Folder . Navigate to MQL4 (or MQL5 ) > Libraries . Paste the telegram4mql.dll file into this folder. 3. Enable DLL Imports in MetaTrader
For the end user, the most important takeaways are to , and to be aware that while telegram4mql.dll itself is not a virus, it has become a victim of its own popularity, often being falsely flagged or—more dangerously—used as a disguise for actual malware. For reliable and secure communication from MetaTrader, it is now recommended to explore maintained alternatives or the developer's official successor project, MMM, for a safer and more sustainable solution.
#import "Telegram4Mql.dll" string TelegramSendText(string apiKey, string chatId, string chatText); string TelegramSendTextAsync(string apiKey, string chatId, string chatText); string TelegramGetUpdates(string apiKey, int offset); #import Use code with caution. Copied to clipboard
: It is often cited as the best available software for this specific purpose, saving traders significant manual effort. telegram4mql.dll
: Some advanced versions allow "Listen" functions, where you can send commands from Telegram (e.g., ) back to MetaTrader. How it Works in MQL To use the DLL, it must be placed in the MQL4\Libraries MQL5\Libraries
Integrating a dedicated DLL into your trading workflow offers several distinct advantages over standard MQL coding methods:
The DLL requires a Telegram Bot token and your unique Chat ID to know where to deliver the data. Open Telegram and search for the . Start a chat and send the command /newbot . Follow the prompts to name your bot and choose a username. To use the library, place the file in
: Since it is an external file, your EA will not run on a VPS or another PC unless the
Whether you need code snippets for or parsing incoming text commands .
Do you need your bot to only , or do you want it to receive commands to close trades remotely? Share public link Navigate to MQL4 (or MQL5 ) > Libraries
: Routes signals to private chats, public channels, or premium subscriber groups simultaneously. Step-by-Step Installation and Configuration
Most versions of this library wrap complex JSON and HTTP requests into simple MQL functions like SendTelegramMessage() .
To use the functions compiled inside the DLL, you must declare them at the top of your script using the #import directive.
Incorrect Token, Chat ID, or the bot has not been initiated.
The code below demonstrates the import block and a sample call: