Working with Telegram in MetaTrader. Telegram channels and bot

Push.Mail. Working with email and notifications in MetaTrader
Alert in the indicator. How to insert Alert and Arrow into your indicator?
Push.Mail. Working with email and notifications in MetaTrader
Alert in the indicator. How to insert Alert and Arrow into your indicator?

About Telegram in MetaTrader

Using Telegram within the MetaTrader platform involves integrating Telegram channels and developing a Telegram bot.

This integration enables smooth communication and interaction, significantly enhancing the functionality of the MetaTrader environment.

In this article, we will explain “How to configure the terminal and Expert Advisor to work with a Telegram bot and channel“.

By using our Expert Advisors for MetaTrader in combination with our EAPADPRO panel, you can stay up to date with the opening and closing of trades, the modification of Stop Loss and Take Profit, as well as any errors encountered by the Expert Advisor.

You can even receive screenshots of the chart where our Expert Advisor is installed.

You will also have the ability to manage our Expert Advisors via a Telegram bot and request real-time information about your account and currency pairs.

In a previous article, we discussed working with Mail and Push notifications in the MetaTrader terminal.

A Telegram bot is a program that automates tasks and interacts with users through the Telegram messenger.

Information bots provide data such as account status, contract specifications, quotes, and other useful information about currency pairs, along with screenshots of Expert Advisors working in the terminal.

They also allow for the management of Expert Advisors from within the terminal.

Assistant tools and Expert Advisors send updates on the opening, closing, and modification of trade deals within MetaTrader. You will receive up-to-date information on all current trade deals.

Terminal Setup for Telegram

To enable the Telegram bot and EAPADPRO panel to work with the Telegram channel, you must allow API access to Telegram in the terminal settings:

1. Go to Terminal Options.

2. Navigate to the Expert Advisors tab.

3. Enable communication between the Expert Advisor and Telegram API:
https://api.telegram.org
Ensure you record https://api.telegram.org in MetaTrader 4.

Creating a Bot in Telegram

To establish communication between a Telegram bot and the terminal, you need to create a Telegram bot from your Telegram account.

Search for the BotFather bot: @botfather (Be cautious as there are many fake accounts.)

Creating a bot in Telegram

The /newbot command allows you to create a bot.

Creating a bot in Telegram 2

Follow the prompts to name your bot and choose a username, ensuring it ends with _bot (e.g., Test333883887_bot).

Creating a bot in Telegram 3

After successfully creating the bot, you will receive a unique Telegram bot token.

It is needed to enter this token in the Expert Advisor settings.

Creating a Telegram Public Channel for Notifications

To enable the Expert Advisor to work with the Telegram bot, you need to set up the bot on your phone and create a “public” channel.

You will need to assign the bot as an administrator of your “public” channel in order to receive notifications from your account.
Note: Sending notifications and working with commands may require computer resources!

Use the Telegram bot only for personal purposes.

To do this, open Telegram, click on the left menu, and select New Channel.

Creating a Telegram Public Channel for Notifications

Follow the steps to create your channel, where you will receive notifications about new trades and errors from the terminal.

Be sure to assign your bot (created earlier) as the Admin of your channel.

Creating a Telegram Public Channel for Notifications 2
Creating a Telegram Public Channel for Notifications 3

Creating a Telegram Private Channel for Notifications

To use the Expert Advisor with the Telegram bot, you need to create a “private” channel on your phone.

Assign the bot as an administrator of your “private” channel to receive account notifications.


Note: Sending notifications and processing commands may consume computer resources!

Use the Telegram bot for your personal purposes only.

Go to your Telegram app, open the left menu, and select New Channel.

Create your channel using the prompts provided, where you will receive updates on new trades and errors.

Make sure to assign your bot (created earlier) as the Admin of your channel.

To work with a private channel, you will need to know the ID of your channel.
Find the bot named @username_to_id_bot to get your channel ID.
Warning: Be cautious of fake channels.

Creating a Telegram Private Channel for Notifications

Use the bot’s guidance to find the necessary channel and retrieve its ID.

Enter the retrieved ID into the settings of your Expert Advisor and EAPADPRO panel.

Setting Up an Expert Advisor to Work with Telegram Bot

Go to the Expert Advisor Settings and scroll to the bottom. You will find the settings to configure the Telegram bot:


==TG_Token=”” –> Token bot. This is the unique token (code) of the bot that will send notifications and receive commands.
==TG_ChannelName=”” –> Public Channel Name @. Or for a private channel, enter its ID starting with -100. This will allow you to receive notifications about trade actions and errors.
==TG_UserNameFilter=”” –> Whitelisted usernames. List of authorized users (starting with @) who can use the bot.
Note: Sending notifications and processing commands consumes computer resources! Use the Telegram bot only for personal needs.
==TG_UseBotTimer=false; // Enable this option to work with the bot from your phone. You can send commands from your phone and receive trade updates (e.g., screenshots, trade information, and Expert Advisor management).

TG_UpdateMode=UPDATE_SLOW –> Controls the update frequency for receiving commands from the bot. Faster updates use more computer resources. Avoid changing the default settings unless necessary. Options: 2sec, 3sec, 10sec.
==TG_PRIORITY=TG_HOME_VPS –> Determines the bot’s working priority between the MetaQuotes VPS and your home computer.
TG_HOME_ONLY=1, // Only run the bot on the home computer.
TG_VPS_ONLY=2, // Only run the bot on the MetaQuotes VPS.
TG_VPS_HOME=3, // First VPS, then HOME. The bot will work on the MetaQuotes VPS if installed, otherwise it runs on the home terminal. It checks VPS every 10 minutes.
TG_HOME_VPS=4, // First HOME, then VPS. The bot runs on the home computer, but switches to the VPS if the home terminal is offline. Checks the VPS server every 10 minutes.
Note: Screenshots are not supported on the MetaQuotes VPS.

Make sure to note down your bot’s Token and Channel.

Setting up an Expert Advisor to work with Telegram bot

In order to receive notifications in your Telegram channel, enable the following options in the EAPADPRO panel settings:

==Notice Open TG – Send a notification to the Telegram channel when a trade is opened;
==Notice Close TG – Send a notification to the Telegram channel when a trade is closed;
==Notice Modify TG – Send a notification to the Telegram channel when a trade is modified;
==Notice Error TG – Send a notification to the Telegram channel if an error occurs;
==ScreenShot TG – Send a screenshot to the Telegram channel when a trade is opened or closed;

Setting up an Expert Advisor to work with Telegram bot 2

After successful configuration, you will start receiving information about new trades and closed trades in your Telegram channel:

Result: Setting up an Expert Advisor to work with Telegram bot

Working with the Bot from Your Phone Using OnTimer Mode

Work with the Telegram bot from your phone and the terminal (request screenshots, information, and manage the Expert Advisor).

Working with the bot from the phone with OnTimer mode

Questions?

If you have any questions, feel free to ask. We don’t sell a pig in a poke. You can check all of our products before purchasing.

We appreciate your feedback and suggestions about our products and always strive to maintain a high standard of quality.

Thank you for staying with us!

Do you have a question?

Leave a Reply

Your email address will not be published. Required fields are marked *

This post is also available in: English Українська Portuguese Español Deutsch Chinese Русский Français Italiano Türkçe 日本語 한국어

Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.


     

    Risk Warning:


    Past trading performance does not guarantee future results.

    Trading foreign exchange on margin carries a high degree of risk and may not be suitable for all investors.

    Be aware that using trading robots involves substantial risk, and you could lose more than your initial investment.

    Please proceed with caution, assess your financial situation carefully, and consider seeking advice from a qualified professional.

    Disclaimer

    This website uses cookies to improve your experience. By using this website you agree to our Data Protection Policy and Disclaimer.
    Read More