telegram.mqh reply to msg - page 3

 

Greetings and best regards

------------------------------------------------------------

Your code about replaying messages in Telegram was very interesting.

If you can, please enter the full code here.

When the position on MetaTrader 4 opens, a message will be inserted in the channel and after hitting itsTP, it will replay the message and write hits the TP.

 

Hi everyone.

I am trying to retrieve the chat info using the piece of code bellow, but of all vatiables I am setting, only 'text' returns a value. All other return nothing ( empty or null string ). 

Does anyone have an idea of what is happening ?


Thanks in advance

//+------------------------------------------------------------------+
//| CMyBot Class extended method                                                                 |
//+------------------------------------------------------------------+
void CMyBot::ProcessMessages()
  {
   for(int i = 0; i < m_chats.Total(); i++)
     {
      CCustomChat *chat = m_chats.GetNodeAtIndex(i);
      if(!chat.m_new_one.done)
        {
         
	 int	id = chat.m_new_one.chat_id;
         string text = chat.m_new_one.message_text;
         string user1 = chat.m_new_one.chat_username;
         string user2 = chat.m_new_one.from_username;
         string name = chat.m_new_one.from_first_name;
         string lastname = chat.m_new_one.from_last_name;
         string type = chat.m_new_one.chat_type;
         chat.m_new_one.done = true;
...
 
Hello can someone provide me all this code for mt5 , i can pay !

I have not code knowledge and i would like to compile this script , to receibe my alerts with screenshots in telegram.

Thanks!
 
OrelMely:
Hello can someone provide me all this code for mt5 , i can pay !

I have not code knowledge and i would like to compile this script , to receibe my alerts with screenshots in telegram.

Thanks!

You can use Freelance

Creating an Order - Freelance service at MQL5.com
Creating an Order - Freelance service at MQL5.com
  • www.mql5.com
Order a technical indicator, trading robot or any other trading application from Freelance
 

Amazing work! 

Trying to realize trade via buttons from Telegram bot to close trades in MT4 account, but found that channel easy to find via TG search, if anyone has idea how to do access for only 1 user via password entered before trade-buttons will shown, or we can get a device ID and describe this in EA text field #.

Maybe idea with a channel (not a bot) will be better, as I don't need a keyboard if device# described in EA.

 



Hello   Lorentzos Roussos,


are you able to help me with getting edit message? The original telegram.mqh does not support edited message.

 
Lorentzos Roussos #:

No it was okay . 

Hello
I used your code, but why does it repeat a message and send it many times, please help.
 
tdbguy #:

This is because this isn't a reply, and yes I thought exactly the same thing about the photo, but I tried with a different one and it doesnt change anything.


edit:

Alright I found what was the error

I removed the "=" -> 

Good job man. 
this code solved my problem.
 
I bless the day I came across this thread. I always thought I was limited.
 
Lorentzos Roussos #:

Oh my god ,messy answer ,sorry(just having coffee)

Let me simplify

  1. Your ea opens a buy order with ticket 16425
  2. You now know that ticket because the trade went through .
  3. What you want to do now is post to your channel about the opening of this trade
  4. You form a message and call SendMessageGetID 
  5. The SendMessageGetID function , provides an ID -fills in- variable last_message_id (if the function fails it fills it with -1)
  6. So after the post for your trade is done in the channel, last_message_id (if not -1) has the position of the message in the channel (essentially)
  7. So your trade is posted in the channel succesfully and if you read last_message_id its 55 ,which means the thing you just posted is post #55 in the channel
  8. What your ea has to do is remember (log/save) that Buy order with MT4 Ticket 16425 is tethered/linked/related to post #55 in the channel 
  9. When order 16425 is closed ,you reply to message #55 (quoting it) .


Dear Sir, do you have clue how to delete a message when we already have its message_id ? thank you in advance

Reason: