Telegram CPP/Mt4 how to listen to messages in a invite-only channel, application has to be distributed
Telegram CPP/Mt4 how to listen to messages in a invite-only channel, application has to be distributed
Loading saved threads...
Thimma · External communityPost link
External question — Stack Overflow Stack Exchange
Author: Thimma
Original post: https://stackoverflow.com/questions/64521745
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
I'm working on an MT4 expert advisor and I just can not solve my scenario, maybe you guys can help me out.
Scenario
A user installs the EA
(expert advisor)
on MT4, there is a invite-only Telegram group which posts messages. The user and/or the bot are in that channel.
What I would like to achieve
I would like my application to be able to read the messages in that group, it can be bot-based aswell as user-based but it
must be able to be distributed
!
What I've tried
Make a bot and add it to the group, I can query messages with this but I can't distribute it since the bot key has to be kept private
(says the Telegram BotFather)
.
Try to use TDLib but I don't think MQL4 supports it, and that's a little too much for what I would like to achieve.
I can for example also make my own API which is connected the bot in the group, and forwards those messages, so I don't have to distribute the bot key but just the URL with a key. I'm not convinced of this solution, though.
The code
I've included the
Telegram.mqh
Library in my MQL4 code.
#property strict
#include <Telegram.mqh>
int OnInit()
{
// How to connect to the group and listen to messages?
return (INIT_SUCCEEDED);
}
void OnDeinit(const int reason)
{
}
void OnTick()
{
}
I'm completely stuck on how to approach this problem, please help me out.
Quote
Report
Andy Thompson · External communityPost link
External answer — Stack Overflow Stack Exchange
Author: Andy Thompson
Original post: https://stackoverflow.com/a/69970158
License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/
Adaptation: HTML converted to plain text; contact email addresses removed.
You could start with telethon in python script. If you were using mt5 you could trade out of the same script, but for mt4 you would have to use an ea and use a csv intermediate file
Quote
Report
Post Reply
Quoted from Forex.com.bd-Editorial External answer — Stack Overflow Stack Exchange Author: Andy Thompson Source score (net votes, not local likes): 1 Original post: https://stackoverflow.com/a/69970158 License: CC BY-SA 4.0 — https://creativecommons.org/licenses/by-sa/4.0/ Adaptation: HTML converted to plain text; contact email addresses removed. You could start with telethon in python script. If you were using mt5 you could trade out of the same script, but for mt4 you would have to use an ea and use a csv intermediate file
Checking account access…