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.
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)
{
intid = 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;
...
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.
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.
Oh my god ,messy answer ,sorry(just having coffee)
Let me simplify
Your ea opens a buy order with ticket 16425
You now know that ticket because the trade went through .
What you want to do now is post to your channel about the opening of this trade
You form a message and call SendMessageGetID
The SendMessageGetIDfunction , provides an ID -fills in- variable last_message_id (if the function fails it fills it with -1)
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)
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
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
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
Allow the use of cookies to log in to the MQL5.com website.
Please enable the necessary setting in your browser, otherwise you will not be able to log in.
You are signed in. Two-factor authentication has been disabled. Set it up again and scan a new QR code, or continue with two-factor authentication disabled.
Greetings and best regards
------------------------------------------------------------
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
I have not code knowledge and i would like to compile this script , to receibe my alerts with screenshots in telegram.
Thanks!
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
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.
No it was okay .
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 "=" ->
this code solved my problem.
Oh my god ,messy answer ,sorry(just having coffee)
Let me simplify
Dear Sir, do you have clue how to delete a message when we already have its message_id ? thank you in advance