Telegram Trade Watcher
- Utilitys
- Thomas Bolognesi
- Version: 2.5
- Aktivierungen: 5
This guide describes the functionalities of our Expert Advisor (EA) for MetaTrader that sends real‑time notifications via Telegram. The system is ideal for traders who want to stay updated on their trades—whether opened manually or by other EAs—and includes chart screenshots for visual context. In addition to standard trade open and close notifications, the system now also alerts you if an order is modified (for example, when the Stop Loss is updated or moved to Break Even).
Main Features
Startup Notification
- What It Does:
When the EA is attached to a chart, it sends an initial Telegram message confirming the connection and displays the current account balance.
Trade Open Notification
- What It Does:
When a new trade is opened (either manually or via EA), the system immediately sends a message including:- Order ticket
- Trade type (BUY/SELL)
- Opening price
- Lot size
- Stop Loss (if set)
- Risk/Reward Ratio (if both SL and TP are set; otherwise, “N/A”)
- Timestamp of the trade opening
- A screenshot of the chart for visual context
Trade Modification Notification
- What It Does:
The system continuously monitors open orders. If a modification is detected (for example, if the Stop Loss is updated), it sends a notification:- If the new Stop Loss is very close to the opening price (within a pre-defined threshold), the message indicates that the order has been moved to Break Even.
- Otherwise, it sends a standard notification with the new Stop Loss value.
Trade Close Notification
- What It Does:
When a trade is closed, the system sends a detailed message including:- Order ticket
- Opening and closing prices
- Profit or loss
- Reason for closure (e.g., Stop Loss hit, Take Profit hit, or manual closure)
- Timestamp of the trade closure
Daily Summary
- What It Does:
At 23:00 each day (or at a configured time), if a daily summary hasn’t been sent within the last hour, the EA compiles and sends a summary that includes:- The date
- Total number of trades
- Number of winning and losing trades
- Total profit or loss for the day
Requirements and Setup
1. Creating Your Telegram Bot
- Step 1: Open Telegram and search for @BotFather.
- Step 2: Send the command /newbot and follow the instructions to create your bot.
- Step 3: You will receive an API Token (e.g., xxxx:yyyyyyy ). Save this token for later use.
2. Obtaining the Chat ID
- Step 1: Add your bot to a Telegram group or channel, or use a service like @userinfobot to get your Chat ID.
- Step 2: Copy the Chat ID; you will need to enter it into the EA configuration.
3. Configuring the EA in MetaTrader
- Step 1: Open the MetaEditor and paste the EA source code.
- Step 2: Replace the constants TelegramBotToken and ChatId with your own values.
- Step 3: Ensure the URL https://api.telegram.org is added to the list of allowed URLs in MetaTrader (Tools → Options → Expert Advisors → Allow WebRequest for listed URL).
- Step 4: Compile the EA and attach it to the desired chart.
How the System Works
At EA Startup:
- Notification:
The EA sends an initial Telegram message confirming the connection and displaying the current account balance.
Order Monitoring:
-
On Trade Open:
The EA continuously monitors open orders. When a new order is detected, it registers the order’s details (ticket, open price, lot size, Stop Loss, etc.), calculates the risk/reward ratio (if applicable), and sends a notification. A screenshot of the chart is captured at the moment of opening and sent to provide visual context. -
On Trade Modification:
For each active order, the EA checks if the Stop Loss has been changed.- If the new Stop Loss is very near the opening price (determined by a set threshold), it sends a notification indicating that the order has been moved to Break Even.
- Otherwise, it sends a notification with the updated Stop Loss value.
-
On Trade Close:
When a trade is closed, the EA sends a detailed message with the order’s ticket, opening/closing prices, profit or loss, the reason for closure, and the timestamp.
Chart Screenshot:
- How It Works:
The EA uses the ChartScreenShot() function to capture an image of the current chart when a trade is opened. This screenshot is then sent to Telegram using a multipart/form-data WebRequest, ensuring you have a visual snapshot of market conditions at the time of the trade.
Daily Summary:
- How It Works:
At 23:00 (or a configured time), if a daily summary has not already been sent within the last hour, the EA compiles statistics for the day (total trades, winning/losing trades, overall profit or loss) and sends them as a summary message to Telegram.
Benefits of the System
-
Real-Time Updates:
Stay informed with immediate notifications on Telegram, eliminating the need to constantly monitor MetaTrader. -
Visual Context:
With chart screenshots, you get a clear visual representation of market conditions at the time of each trade. -
Comprehensive Monitoring:
The system tracks trades opened manually as well as those managed by other EAs, and now also alerts you to modifications like Stop Loss updates. -
Enhanced Trade Information:
Receive detailed trade data including lot size and risk/reward ratio, helping you make more informed decisions. -
Daily Performance Summary:
A concise end-of-day summary helps you review your trading performance effectively.
Support and Maintenance
If you have any questions, require further customizations, or need technical support, please do not hesitate to contact us. Our team is available to help you integrate and tailor the system to your trading needs.