MT5 to Telegram Notification Hub

MT5 to Telegram Notification Hub

22 September 2024, 19:55
George Liviu Geambasu
0
581

Introduction

MT5 to Telegram Notification Hub is a user-friendly tool that connects MetaTrader 5 (MT5) with Telegram, enabling seamless transmission of trade alerts, updates, and custom messages directly from MT5 to your Telegram account or channel. You can easily adjust and enable or disable specific parts of the notifications, making it ideal for signal providers and traders who want to keep their audience informed with real-time updates.

Link to the producthttps://www.mql5.com/en/market/product/124832

Installation


Setup of the Telegram Bot

  • Go to telegram and search https://t.me/BotFather
  • Write /newbot , the chat will give you instructions.
  • Chose name and username for the bot.
  • Send /setuserpic and setup the profile picture for the bot, you can use the logo of the product
  • You will get the token from the message provided by BotFather.

Reference for BotFather create a new bot


Add bot to telegram group/chat

  • Create telegram group/channel where the bot will be added
  • Add the new created bot to the channel and make it admin.
    Group Info -> Manage Group -> Administrators -> Add Administrator -> {the bot} -> Save
  • Write a simple message to 
  • Get the token provided by BotFather
  • Open your browser (Chrome, Firefox, Brave) and access the link https://api.telegram.org/bot{token}/getUpdates (replace the {token} with the token provided)
  • Get ChatId from the message provided by URL:



  • Get both Token and ChatId and use it later to setup the EA

Open and setup EA

  • Open the Expert Advisor and add Token and ChatId in the variables



  • Allow WebRequest for Telegram API - add URL https://api.telegram.org in Allow WebRequest section in MetaTrader application:
    Tools -> Options -> Expert Advisors

Allow WebRequest


Now you can enjoy the EA, further setup can be made in the application.


User Interface


Reports Tab

You can get daily, weekly and monthly reports on demand. Pressing one of the buttons will send a message which include reporting details, details that will be customized based on the setup that you made in Reports setup.




App Setup Tab

Here it is all the setup types:



  1. General - general settings that affect all orders
  2. New Order - settings for new order messages
  3. Close Order - settings for order close messages
  4. Pending Activ. - settings for pending order activation messages
  5. Order Modif. - settings for order modification messages
  6. P. Order Modif - settings for pending order modification messages
  7. Reports - settings for report message (affect also report messages on demand and also automated reports messages)


General settings

These are the general settings customization.



  1. Send Message - allow sending messages to Telegram group/channel
  2. Time Offset - time offset between broker time and VPS time
  3. BE profit percent - the profit percent that will be consider as break even. If the percent is setup at 0.2% (as in example), if a trade   will be close and the profit percent is 0.1%, will be considered as break even, if will have 0.5% that will be   considered as winning trade. Same applies also for losing trades, if a trade will have a losing of 0.1% that will be   considered also as break even.
  4. Distance Type - setup that make references to the distance of a trade that can be in pips or pipettes
  5. Screenshot Width - the width in pixels of a screenshot
  6. Screenshot Height - the height in pixels of a screenshot


New Order settings

Settings for New Order messages


  1. Send Messages - allow sending messages for any new orders (active orders or pending orders)
  2. Send P. Orders - allow sending messages for any new pending order
  3. Send Screenshot - allow sending screenshot for any new order
  4. Screenshot Period - setup timeframe for the screenshot
  5. Show Ticket No. - send ticket number of the order
  6. Show Volume - send volume of the order
  7. Show SL - send Stop Loss level setup
  8. Show TP - send Take Profit level setup
  9. Show RR - send Risk-Reward ratio of the order, based on the TP and SL levels
  10. Show Balance - send current balance of the account
  11. Show Win - send possible win of the new order, based of the TP level
  12. Show Loss - send possible loss of the new order, based of the SL level
  13. Show Margin - send the used margin of the account
  14. Show Free Margin - send the available free margin of the account
  15. Show Comment - send comment of the order
  16. Delay Period - IMPORTANT!!!! this the period of seconds which you can delay the sending of the message of the new order to Telegram. This is used when you are used to open a trade and after that you will setup SL and TP levels.


Close Order

Settings for Close Order messages


  1. Send Message - allow sending close order message
  2. Show Ticket No. - send ticket number of the order
  3. Show Entry Price - send the price of the order when was opened
  4. Show Close Price - send the price of the order when was closed
  5. Show Profit - send the profit amount of the order
  6. Show Profit Perc. - send the profit percent of the order
  7. Show Pips - send the number of pips/pipettes between open price and close price
  8. Show Volume - send the volume of the order
  9. Show Duration - send the time duration of the trade
  10. Show Balance - send the balance of the account
  11. Show Reason - send the reason which the order was close (manual close, automated close, close due to SL or TP)
  12. Send Partial Close - allow sending partial close of the order
  13. Send Perc. Close - send the percentage of the volume closed

Pending Order Activation settings

Settings for Pending Order Activation messages


  1. Send Message - allow sending message for pending order activation
  2. Show Ticket No. - send ticket number of the order


Order Modification settings

Settings for Order Modification message, only active orders


  1. Send Message - allow sending message for order modification
  2. Show Ticket No. - send ticket number of the order
  3. Show New Loss - send the new possible loss of the modified order
  4. Show New Win - send the new possible win of the modified order


Pending Order Modification settings

Settings for Pending Order Modification messages, only pending orders



  1. Send Message - allow sending message for pending order modification
  2. Show Ticket No. - send ticket number of the pending order
  3. Show New Price - send new modified target price for pending order
  4. Show SL - send new SL level for the pending order
  5. Show TP - send new TP level for the pending order


Reports settings

Settings for Reports message


  1. Daily Report - allow for sending automated daily report. This will be send every day at the time specified at Report Time      section
  2. Weekly Report - allow for sending automated weekly report. This will be send every week for the week before, at the time     specified at Report Time section, and at the day of the week specified at Report Day Weekly section
  3. Monthly Report - allow for sending automated monthly report.  This will be send every first day of the month, at the   time specified at Report Time section
  4. Custom Report - allow for sending automated custom report. This will be send every day at the time specified at Report   Time section, and will be setup for the last number of days specified at Custom Report Days section
  5. Custom Report Days - set number of days for which the automated custom report to be generated
  6. Report Time - specify the hour of the reports to be sent
  7. Report Day Weekly - specify the day of the week for weekly report
  8. Show Pips - send number of pips/pipettes for every closed trade from the report
  9. Show Profit - send the profit for every closed trade
  10. Show Profit Perc. - send the profit percent for every closed trade
  11. Show Total Pips - show total number of pips/pipettes gained on all closed orders in the report
  12. Show Total Profit - show total profit for all the closed report in the report
  13. Show Win Loss BE - show total number of win trades, loss trades and break even trades
  14. Show Total Orders - show total number of orders
  15. Show Win Rate - show the percent of win trades
  16. Active/Pending Orders - show the active and pending orders


Test Messages


This tab is used to test the correct setup of the Telegram settings. You can send a test message for a open order and one for close order.