MT5 to Telegram - Professional Trade Notification Library - MetaTrader 5 Library - MetaTrader 5 Resources
#includeCTelegramBot robot; integer initialization () { // Initialize bot if (!bot.initialize( "your token". , "your chat id" )) { print ( "Failed to initialize robot" ); Return initialization failed ; } //Send test message robot.Send message( "Robot connection successful!" ); // Send a screenshot of the chart bot.SendChartScreenshot( "Current market conditions." ); Return initialization successful ; }
Boolean Send Message ( String Text); Boolean Send HTML Message ( String Text); Boolean Send Markdown Message ( String Text); Boolean Send Message Everyone ( String Text);
Boolean SendTradeSignal(ENUM_SIGNAL_TYPE type, string symbol, double price); Boolean Send Opened Position( Oolong ticket, String symbol, ENUM_POSITION_TYPE type, Double volume, Double price); Boolean Send Closed Position( Oolong ticket, String symbol, Double profit, Double commission, Double exchange);
Boolean send photo( string file path, string title); boolean send document( string file path, string title); boolean send chart screenshot(); boolean send chart screenshot( string title);
Boolean Send Account Status(); Boolean Send Daily Report(); Boolean Send Weekly Report(); Boolean Send Monthly Report();
Boolean value sends risk alert ( double drawdown percentage); Boolean value sends margin warning ( double margin level); Boolean value SendStopOutWarning();
The package contains a fully functional Expert Advisor example that demonstrates:
String message = " <B> Жирный текст B >\n"; message +=" <i> kulsif i >\n"; message +=" <code> Моноширинный код Code >\n"; message +=" <a link='http://example.com'> sciliaka a > "; bot.SendHTMLMessage(message);
string message = "bold text{\n}" ; message += "Italic." ; message += "Monowidth code." ; Message += "[Link](http://example.com)" ; bot.SendMarkdownMessage(message);
The library includes sophisticated error handling:
The library is provided "as is" for use in MetaTrader 5. Free for personal and commercial use.
Forex Trading Blueprint
(Stepan Sinich)
THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. Trading involves significant risk of loss and is not suitable for all investors. Past performance is not indicative of future results.
If you find this library useful, please rate it on the MQL5 Code Base!
Create a new bot
Configure the robot
Solution: 1. Tools → Settings → Advisor 2. ✓ Allow WebRequest for the following URLs 3. Add: https://api.telegram.org 4. Restart MT5
Check: 1. Token is correct 2. Chat ID is correct 3. Internet connection 4. WebRequest settings
Possible reasons: 1. Exceeded API limit (30 messages/minute) 2. Incorrect HTML format in message 3. Message too long (>4096 characters)
bot.SendTradeSignal(SIGNAL_BUY, "EUR/USD" , 1.1850 , 1.1800 , 1.1900 );
string title = " <B> Tokka Warda B >\n"; Title += "Пара: EURUSD\n"; title += "Тип: Purchase\n"; title + = "Цена: 1.1850"; bot.SendChartScreenshot(title);
bot.SendAccountStatus(); // Automatically send balance, net worth, margin, etc.// In the OnTimer() advisor if (timehour( timecurrent ()) == 23 && timeminute( timecurrent ()) == 0 ) { bot.SendDailyReport(); }
Double retracement = calculate retracement(); // your calculation function if (retracement > 20.0 ) // retracement exceeds 20% { bot.SendRiskAlert(retracement); }
[Opened position] ↑ =============== Ticket : #12345678 Symbol: EURUSD Type : Buy Volume: 0.10 Price: 1.18500 Time: 2024.01.15 10:30 ===============
[position closed] =============== Ticket: #12345678 Symbol: EURUSD Profit: + 125.50 USD Commission: - 2.00 Exchange: - 0.50 Total: + 123.00 USD Time: 2024.01.15 14:45 ===============
[Daily Report] =============== Date: January 15, 2024 Account Summary---------------- Balance: $10,125.50 Equity: $10,250.00 Floating P&L: +$124.50 Trading Activity---------------- Today’s Transactions: 5 Today's results: +$250.00 Open positions: 2 Robot statistics---------------- Messages sent: 45 Send signal: 8 Success rate: 98.5% ===============
Candlestick chart that relates the ask and bid prices to the high and low prices of the candle
This is an auxiliary take-profit and stop-loss tool that can help you with tight stops and dynamic take-profits. updated
This is an OHLC candlestick chart recording the highest ask and lowest bid for each new bar.
A simple information indicator showing the remaining time before the bar closes, as well as the elapsed time since the bar opened and the current time.
Attachment download
📎 testbot.mq5 (42.56 KB)
📎 TelegramBot.mqh (186.27 KB)
Source: MQL5 #63585
💡 Featured Recommendations
✍️ Latest by the author
- •
- •
- •
- •
- •
- •
📌 Popular topics
- •
- •
- •
- •
- •
- •
- •
- •
🔗 You May Be Interested In
- •
- •
- •
- •
- •
- •