文章 "如何采用 MQL5 创建用于 Telegram 的 bots" - 页 47

 
seyed mohammad reza aalami #:

朋友们好,我使用以下代码向 Telegram 发送信息。我的问题是,信息不是发送一次,而是发送多次。

请指导我。

将代码从 OnTick 移到 OnInit

 
你好!如何在打开、关闭和修改订单时发送消息?谁能举例说明?
 

我想知道是否有 MT4 版本?

看起来它只能在 MT5 上运行

非常感谢

 
Burak Tohumcu #:

我想知道是否有 MT4 版本?

看起来它只能在 MT5 上运行

非常感谢

该库同样适用于 MT4,只需复制并粘贴到 mql4 包含文件即可

 

好的,朋友们、

有没有人可以分享将 mt5 买入卖出信号 发送到 Telegram 账户的工作代码?


PS: 给管理员们;请停止引用自由版块,谢谢:)

 
亲爱的朋友们,大家好
我在 Expert 中使用 Telegram.mqh 与 Telegram 通信,但遇到了一些问题

1- 我无法在 Expert 中阅读发送到 Telegram 频道的最后一条消息

2- 我可以阅读组内用户发送的信息,但无法阅读其他Telegram 机器人 发送的信息。

感谢您帮助我解决任何问题。
How to create bots for Telegram in MQL5
How to create bots for Telegram in MQL5
  • www.mql5.com
This article contains step-by-step instructions for creating bots for Telegram in MQL5. This information may prove useful for users who wish to synchronize their trading robot with a mobile device. There are samples of bots in the article that provide trading signals, search for information on websites, send information about the account balance, quotes and screenshots of charts to you smart phone.
 
int               GetUpdates()
   {
      if(m_token==NULL)
         return(ERR_TOKEN_ISEMPTY);

      string out;
      string url=StringFormat("%s/bot%s/getUpdates",TELEGRAM_BASE_URL,m_token);
      string params=StringFormat("offset=%d",m_update_id);
      //---
      int res=PostRequest(out,url,params,WEB_TIMEOUT);
      //CJAVal js(NULL,jtUNDEF);
     // if(res==0)
       // Print("");
      if(res==0)
      {
         //Print(out);
         //--- 解析结果
         CJAVal js(NULL,jtUNDEF);


在调试模式下,终端每次都会崩溃。在 "if(res==0) "时,我按 F10 键,终端就会崩溃。我必须重新启动。res 值为 0。

元读取器中有这样的日志:

2022.07.12 10:40:03.212 MQL5 debugger   failed to read string length (00000095 BB7FE075)
2022.07.12 10:40:03.217 MQL5 debugger   failed to read string length (00000095 BB7FE150)
2022.07.12 10:40:03.217 MQL5 debugger   failed to read memory with error 299
2022.07.12 10:40:03.217 MQL5 debugger   failed to read memory (4 bytes from 00000095 BB7FE13C)
2022.07.12 10:40:03.217 MQL5 debugger   failed to read string length (00000095 BB7FE140)
2022.07.12 10:40:03.217 MQL5 debugger   failed to read string length (00000095 BB7FE160)
2022.07.12 10:40:03.217 MQL5 debugger   failed to read memory with error 299
2022.07.12 10:40:03.217 MQL5 debugger   failed to read memory (1 bytes from 00000095 BB7FE0AF)
2022.07.12 10:40:03.217 MQL5 debugger   failed to read memory with error 299
2022.07.12 10:40:03.217 MQL5 debugger   failed to read memory (1 bytes from 00000095 BB7FE0AE)
2022.07.12 10:40:03.217 MQL5 debugger   failed to read memory with error 299
2022.07.12 10:40:03.217 MQL5 debugger   failed to read memory (4 bytes from 00000095 BB7FDFD4)
 
Cuneyt Ates #:

好了,各位、

有没有人可以分享将 mt5 买入卖出信号 发送到 Telegram 账户的工作代码?


PS: 给管理员们;请停止引用自由版块,谢谢:)

您好,主要文章中提到了您的要求,事实上有一个名为 Telegram_Signal_EA 的 EA 可以实现您的要求。

 

下午好。

什么原因会导致这个错误?

{"ok":false, "error_code":409, "description": "Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}

 
Vasiliy Pushkaryov #:

下午好。

什么原因会导致这个错误?

{"ok":false, "error_code":409, "description": "Conflict: can't use getUpdates method while webhook is active; use deleteWebhook to delete the webhook first"}

https://core.telegram.org/bots/api#deletewebhook 需要这样做

Telegram Bot API
  • core.telegram.org
The Bot API is an HTTP-based interface created for developers keen on building bots for Telegram. To learn how to create…