Setting up the Utility  "Magic MT4 to Telegram"

Setting up the Utility "Magic MT4 to Telegram"

21 August 2023, 13:21
Federico Giuliano Di Noro
0
219

"Magic MT4 to Telegram" enables connection between MT4 and messenger Telegram for real-time updates.

With customizable settings, you determine which notifications you want to receive when there are changes in your depot.

With every opened or closed position you will receive notifications on your computer or mobile phone.

Made in Germany     -> Feel free to contact me

________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

But how do you set it up correctly and what can the utility actually do?


The most important things are set through the global settings, such as the botfather and the chat ID.

These are responsible for ensuring that your terminal also knows which Telegram chatbot it is communicating with.


In this explanation, all parameters are first explained. Then there is a description of how to set up the botfather.


See the detailed explanation here

Configuration:

Global settings


Botfather ID: This is the ID you get from the botfather. A detailed description of how to start the botfather is given below.
CHAT ID: The Chat ID assigned to you, which you also receive from Telegram. A detailed description of how to do this is given below
Get Chat ID.

DIGITS : Enter the decimal place here if you receive a price. For example 3 digits = 1,000                                                        
Currency : Select your usual trading currency here.
ALL OPEN FUNCTIONS: In order not to select all functions manually when opening an order, there is this entry that makes this easier
and all functions in this rubrick activated.
ALL CLOSE FUNCTIONS: In order not to select all functions manually when closing an order, there is this input the dies
facilitated and activated all functions in this rubrick.
OPEN ORDERS: Returns the number of all outstanding orders. Here already opened, as well as pending orders,
eg BuyStop orders.
TOTAL PROFIT OTF: Returns the profit or loss for the day. Here, calculations are made from 00:00 to 24:00.
TOTAL BALANCE: Is the return of the account balance in your previously set currency.
TOTAL EQUITY: Returns the account equity in your previously set currency.
FLOATING BALANCE: Returns information about the current profit or loss of the open orders.



Now we come to the account information that is returned

Here the input can be selected in four selection windows. Select any parameters you want.


Account Information


bACCOUNT INFORMATION : Activate the function here to send account information to your telegram messenger.
When Send the Account Info : Here you can select the time when the message should be sent. This is what the
Choice "On Opening|On Closing| Both " available.
Account Information1 ... 4: Select the information to be sent upon execution. In the picture below
are the choices.


Input Accountinformation



Now let's move on to output via a default email. Setting up the e-mail address in the terminal follows.

With the e-mail output, you can compose your message yourself.


email parameters

EMAIL ALERT : Activate the function here to send messages to your e-mail.
Your Alert : Enter your own email subject here.
OpenCloseText : Activate this function to get the order comment.
When Send an Email : Choose when to send the email. You can choose between "Opening|Closing|both".
Information : Now choose which information should be included in the e-mail. Define your own
Message with the keywords below:

    Separate the keywords with a comma.


Input E-Mail


Output via the terminal was added as a new feature of update 1.4.

You can also create your own message here. Opening and closing commands must be entered separately.


Message output in the terminal


TERMINAL MESSAGE : The output via the terminal is activated here.
Terminal Message Type : Here you can choose between three layouts how your terminal output should look like. is available for selection
"Same as Telegram|Same as email|New message"
Terminal Information : If you have selected "New Message" for "Terminal Message Type" you can use the below
keywords to create your own message.


Separate the keywords with a comma.


Terminal Message Keywords


Now let's move on to the opening/closing parameters of the Telegram message.

These are simply switched on or off via the input.


opening information

OPEN COMMENT : Give your message an appropriate header. The entry is made here.
OPEN COMMENT : Here you can switch the message you just entered on or off.
OPEN TIME : Sends the opening time of the order.
ORDER TICKET : ticket number of the opened order.
OPEN PRICE : Order opening price.
OPEN SYMBOL : symbol of the opened position.
OPEN LOT : Indicates the order size in lots.
OPEN ORDERTYPE : Sends the order type of the order.
OPEN SL TP : Stop Loss and Take Profit Levels.
OPEN ORDER COMMENT : Comment on the opened order.
OPEN MAGIC NR : If a trading robot opened the order, you will receive its
assigned number.


closure information

CLOSE COMMENT : Customize your custom message when closing an order.
CLOSECOMMENT : Choose whether to send your individual message ("yes/no").
CLOSE TIME : Order closing time.
CLOSE TICKET : ticket number of the closed order.
CLOSE PRICE : Order closing price.
CLOSE SYMBOL : Closed position symbol.
CLOSE LOT : Number of closed lots.
CLOSE ORDERTYPE : Order type of the closed order.
CLOSE ORDER COMMENT : Closed order comment.
CLOSE ORDER MAGIC NR : If a trading bot closed the order, you get
you its assigned number.
CLOSE SINGEL PROFIT : profit/loss of the closed order.
FREE MARGIN : Available margin in your trading account.


Let's now set up the Botfather and the Client ID


Setup of the Botfather

For the Botfather ID, search for "BotFather" in the Telegram chat and start it. The chat should look like below.

Botfather

After starting the botfather you have to do the following:

    1. Send "/start" to get the commands.
    2. Use "/newbot" to create a new Telegrambot.
    3. Now enter the name you want to give your Telegrambot. (Make sure the name ends with "bot").
    4. Congratulations! You have successfully created your Telegrambot.
    5. Now look at which HTTP API is assigned to your bot. You have to enter this in the Expert Advisor under "BOTFATHER_ID".
    6. Go back to the Telegram main page and search Telegram for "userinfobot" for your Chat_ID.
    7. Once you've found this bot, start it with "/start" as well.
    8. Copy the number shown under "Id" and enter it under "CHAT_ID" in the Expert Advisor.
    9. Finally, you have to allow the WebRequest in the Metatrader under "Extras" -> "Options" -> in the "Experts" tab. Enter the following URL in the input field below:

https: //api.telegram.org

This is the permission for the Metatrader to send messages to your Telegrambot.

Remove the space when inserting the link!!

If all settings have been made and entered in the Expert Advisor, you will receive a confirmation message on your bot.

If you need assistance setting up this tool, I'm happy to help.

Have fun with this useful tool!



Share it with friends: