Discussion of article "How to create bots for Telegram in MQL5" - page 23

 
Yu Jia Zi Qu #:

1-In the article,I didnt find anything about reading messages from a telegram channel.How can I do that?

You need to Reread the Attached Code of The Article.
Only Private Channels Are not Addressed Everything Else is addressed.
Even in this Forum the topic is talked about down the the Point of another link being posted to a forum page where the Author posted a code that reads from a public Channel past 20 messages


Yu Jia Zi Qu #:

2-Is there anyway to connect to telegram without bot.Ie,reading user(not bot)messages?

Without Bot NO its not possible with respect to this bot;

 
Can the author or anyone modify this Bot to generate an API code that links up MQL5 EA with Crypto Exchanges like Binance, Huobi, Coinbase etc  
 
There is a library in the Market that links to Binance.
 
Jefferson Metha #:
There is a library in the Market that links to Binance.

Please share the link for such libraries

 
CodeFx #:

Please share the link for such libraries

Top right corner there is a magnify glass icon also known as the search icon
left click it
then type 
" Binance"
Press [ENTER] Key on your desktop

then you will get them no need to scroll down. 

you welcome

 
Jefferson Metha #:

Top right corner there is a magnify glass icon also known as the search icon
left click it
then type 
" Binance"
Press [ENTER] Key on your desktop

then you will get them no need to scroll down. 

you welcome

Thanks, I located the library

 
HOW  getfile to BOT for user download file
 
telegram bot inputFile

How to write this

My English Is not good, sorry
thanks
 
on mq5 side "chat.m_new_one.message_text"  gets the message that user sends to the bot directly which is great.
However can it be used to receive the message that is sent to the channel that the bot (the one which is communicating with the mt5 EA) is a member of ? 
 

Hello friends, I use the following code to send a message to Telegram. My problem is that instead of sending a message once, it sends several times.

please guide me.

#include <Telegram\TelegramL.mqh>


input string InpChannelName="";//Channel Name
input string InpToken="";//Bot Token


CCustomBot bot;

datetime time_signal=0;
//int SendMessage(const string channel_name,
                //const string text);




//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
   time_signal=0;

//--- set token
   bot.Token(InpToken);


//--- done
   return(INIT_SUCCEEDED);
  }
 
  datetime _opened_last_time = TimeCurrent() ;
  datetime _closed_last_time = TimeCurrent()  ;
  
 

//+------------------------------------------------------------------+
//| Expert deinitialization function                                 |
//+------------------------------------------------------------------+
void OnDeinit(const int reason)

{

}
     
  
//+------------------------------------------------------------------+
//| Expert tick function                                             |
//+------------------------------------------------------------------+
void OnTick()
  {
  

   string message = "";
   int total=OrdersTotal();
 
       
   for(int pos=0;pos<total;pos++){  // Current orders -----------------------
     if(OrderSelect(pos,SELECT_BY_POS)==false) continue;
     if(OrderOpenTime() <= _opened_last_time) continue;
     
     message += StringFormat("Order opened!\r\nType: %s\r\nSymbol: %s\r\nPrice: %s\r\nSL: %s\r\nTP: %s\r\nTime: %s\r\nTicket:.%s ",
     order_type(),
     OrderSymbol(),
     DoubleToStr(OrderOpenPrice(),MarketInfo(OrderSymbol(),MODE_DIGITS)),
     DoubleToStr(OrderStopLoss(),MarketInfo(OrderSymbol(),MODE_DIGITS)),
     DoubleToStr(OrderTakeProfit(),MarketInfo(OrderSymbol(),MODE_DIGITS)),
     TimeToStr(OrderOpenTime(),TIME_MINUTES),
     IntegerToString(OrderTicket())
          
      );
    
     int res=bot.SendMessage(InpChannelName,message);
     if(res!=0)
         Print("Error: ",GetErrorDescription(res));
     
     }
  
      
  
      bool is_closed = false;

                   
  total = OrdersHistoryTotal();
      
   for(int pos=0;pos<total;pos++){  // History orders-----------------------
      if(OrderSelect(pos,SELECT_BY_POS,MODE_HISTORY)==false) continue;
      if(OrderCloseTime() <= _closed_last_time) continue;
     printf(OrderCloseTime());
     is_closed = true;
     
     message += StringFormat("Order closed!\r\nTicket: %s\r\nSymbol: %s\r\nClosing Price: %s\r\nTime: %s",
     IntegerToString(OrderTicket()),
     OrderSymbol(),
     DoubleToStr(OrderClosePrice(),MarketInfo(OrderSymbol(),MODE_DIGITS)),
     TimeToStr(OrderCloseTime(),TIME_MINUTES),
     DoubleToStr(order_pips(),1)
     
    
     );
      
      int res=bot.SendMessage(InpChannelName,message);
     if(res!=0)
         Print("Error: ",GetErrorDescription(res));
      
     }
 
   }
   
   
double order_pips() {
   double pips;
   
   if(OrderType() == OP_BUY) {
      pips =  (OrderClosePrice()-OrderOpenPrice())/MarketInfo(OrderSymbol(),MODE_POINT);
   } else {
      pips =  (OrderOpenPrice()-OrderClosePrice())/MarketInfo(OrderSymbol(),MODE_POINT);
   }
   return pips/10;
}

string order_type_to_str(int type)
{
   return StringSubstr(EnumToString((ENUM_ORDER_TYPE)type), 11);
}
string order_type () {
   return order_type_to_str(OrderType());
   
   if(OrderType() == OP_BUY)        return "BUY";
   if(OrderType() == OP_SELL)       return "SELL";
   if(OrderType() == OP_BUYLIMIT)   return "BUY LIMIT";
   if(OrderType() == OP_SELLLIMIT)  return "SELL LIMIT";
   if(OrderType() == OP_BUYSTOP)    return "BUYSTOP";
   if(OrderType() == OP_SELLSTOP)   return "SELLSTOP";
   
   return "{err}";
}
   

   
//---