거래 로봇을 무료로 다운로드 하는 법을 시청해보세요
당사를 Telegram에서 찾아주십시오!
당사 팬 페이지에 가입하십시오
스크립트가 흥미로우신가요?
그렇다면 링크 to it -
하셔서 다른 이들이 평가할 수 있도록 해보세요
스크립트가 마음에 드시나요? MetaTrader 5 터미널에서 시도해보십시오
라이브러리

Telegram Notify - trade notifications, chart screenshots and daily summary for any EA (library + ready EA) - MetaTrader 5용 라이브러리

조회수:
73
평가:
(1)
게시됨:
\MQL5\Include\
MQL5 프리랜스 이 코드를 기반으로 한 로봇이나 지표가 필요하신가요? 프리랜스로 주문하세요 프리랜스로 이동
TelegramNotify

TelegramNotify_chart

Two files:
- TelegramNotify.mqh - the library. Put it in MQL5\Include.
- TelegramTradeNotifier.mq5 - a ready EA built on the library. Attach it to one chart and it reports all trades of the account (manual trades and other EAs). It never trades.

What it sends:
- Opened position: side, volume, symbol, price, SL, TP, ticket, magic, comment.
- Closed position (full or partial): net result in money (profit + swap + commission), points, open price, holding time, close reason (Stop Loss, Take Profit, Stop Out, EA, manual desktop/mobile/web), balance.
- SL/TP changes: old -> new value. Checked every second, so it catches changes made by hand, by any EA or by the broker. Limited to one message per position per N seconds, so trailing stops do not flood the chat.
- Pending orders: placed, deleted, expired, rejected.
- Summary once a day at a chosen server time: closed trades, win rate, net result, open positions and floating P/L, balance, equity, margin level. Each summary starts where the previous one ended, so no trade is lost between summaries. Days without trades can be skipped.
- Chart screenshot on open and/or close (optional). The picture is taken from an open chart of the trade's symbol. Without one, the text message is sent.

Library features:
- Send() for plain text, SendHtml() for bold, italic, code and links, SendPhoto() for any picture in MQL5\Files, SendChart() for a chart screenshot.
- Outgoing queue (50 messages). When there is no internet or Telegram is busy, messages are kept and retried. Telegram's "Too Many Requests" answer is respected.
- About 1 message per second, the limit Telegram allows per chat.
- Messages longer than 4096 characters are split on line breaks.
- Clear errors in the journal: "WebRequest not allowed", wrong token, wrong chat id.
- Strategy Tester: WebRequest does not work there, so messages are printed to the journal (dry run). You can check what your EA would send before running it live.

Use in your own EA:

#include <TelegramNotify.mqh>

CTelegramBot   tg;
CTradeNotifier trades;

int OnInit()
{
   tg.Init("123456:ABC...", "123456789", "MyEA XAUUSD");
   trades.Init(&tg, 12345);              // magic of your EA (-1 = all trades)
   trades.Events(true, true, false, false);
   trades.DailySummary(23, 50);
   EventSetTimer(1);
   tg.Send("EA started");
   return INIT_SUCCEEDED;
}
void OnTimer() { trades.OnTimer(); }     // retries + summary + SL/TP check
void OnTradeTransaction(const MqlTradeTransaction &t, const MqlTradeRequest &q, const MqlTradeResult &r)
{
   trades.OnTransaction(t);
}

Setup:

1. In Telegram, open @BotFather, send /newbot and copy the token.

2. Send any message to your new bot. To find your chat id, open https://api.telegram.org/bot<TOKEN>/getUpdates in a browser and look for "chat":{"id":... For a group, add the bot to the group, write in the group and use the (negative) id. For a channel, make the bot an admin.

3. MetaTrader: Tools > Options > Expert Advisors > check "Allow WebRequest for listed URL" and add https://api.telegram.org


Notes:

- Sending takes a short time (WebRequest is synchronous). Messages are sent from OnTradeTransaction and OnTimer, not from OnTick.

- Times in messages are broker server time.

- Keep your bot token private. Do not share .set files that contain it.

XAUUSD Hang Seng Split: a free gold EA that reads the Hong Kong market XAUUSD Hang Seng Split: a free gold EA that reads the Hong Kong market

This is a free, execution only EA for gold on M15. It compares gold with the Hang Seng (HK50). When gold has split far away from it, the EA trades in the direction of that split, but only while gold itself is calm and hasn't already made the move.

Equity Guard Equity Guard

Closes all positions, deletes pending orders and blocks new trades when the daily loss, drawdown-from-peak or daily profit target is reached. Works with manual trading and any other EA. State survives terminal restart.

Symbol and Trading Conditions Inspector Symbol and Trading Conditions Inspector

Displays live symbol specifications, broker trading conditions, account information, spread, trading permissions, session status and margin properties directly on the MT5 chart.

Risk Calculator - lot size by risk percent and ATR stop Risk Calculator - lot size by risk percent and ATR stop

On-chart panel that sizes your trade: lot size from your risk % and a stop in points or ATR, with spread, broker-minimum, minimum-lot and margin checks. Calculation only - it never trades.