send message from metatrader4 to telegram bot in python - mql4

I am working on automating the trade signals generated in metatrader 4. Idea is to encode the buy/sell signals into message and send to a python telegram receiver code which will decode the message and take appropriate action (like placing orders with broker using broker provided python APIs). any idea how this can be done?
I have so far tried below code, which receives message from my telegram account and replies same text back.
https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot2.py
my requirement is instead of using telegram account on mobile, i need it in the metatrader

today with bit of struggle i figured out a way to achieve my requirement. not an efficient solution but its working. so i am explaining below,
MT4 EA code: once buy/sell signals generated, a message is sent to my first telegram bot (call it A_bot).
A_bot: forwards the received message to second bot(call it B_bot)
python server on vps: same token as that of B_bot is listening to incoming messages. in other words python version of B_bot is listening to incoming messages.
so when A_bot forwards the message recieved by MT4 EA to B_bot, copy of same message is received is received by python server. So in python server code now i am able to process the message and place order accordingly.
so the original problem is i can't do this with just A_bot. there is an extra step involved to forward message from one telegram bot to another to make it work. for this i am using android app Tforwarder.

Related

Issue with character limit in Twilio and responding back manually

I'm facing some challenges with Twilio and was wondering if someone knows how to resolve them. First, would like to highlight that I don't have a programming background but I can write low-level code.
Current Case:
A session is booked > Record is created in Airtable via a Zap with calendly > Twilio sends a message using the info in Airtable via a zap with calendly.
Problems:
I'm currently only able to send 160 characters in the message. If the message is longer, only the first 160 characters are sent and the message is cut short (e.g. looking forwa....)
I don't have an easy way to respond back to messages. Currently Twilio forward all messages to a Voice number in one big thread and I have to respond back in this format
+1123456789: Message.
This is confusing and causes a lot of issues.
Is there any way to build something in Twilio which allows for manual responding?
Thank you all in advance!
Twilio developer evangelist here.
I'm currently only able to send 160 characters in the message. If the message is longer, only the first 160 characters are sent and the message is cut short (e.g. looking forwa....)
This sounds like a limitation of the Zap you are using. SMS messages are 160 characters in length, but Twilio can stitch together up to 10 messages, allowing you to send up to 1600 characters. Twilio doesn't truncate the messages either, so it sounds like something the Zap is doing. In 2017 Zapier did announce that you could send longer messages with their integration, you just had to update your Zap with the right setting.
I don't have an easy way to respond back to messages. Currently Twilio forward all messages to a Voice number in one big thread and I have to respond back in this format +1123456789: Message. This is confusing and causes a lot of issues. Is there any way to build something in Twilio which allows for manual responding?
You could certainly build something. Or integrate with an app like Front which can give you a shared inbox for things like incoming SMS from Twilio.

SendToFlexWidget is not supported for this channel/trigger combination

I'm trying to integrate incoming SMS messages to Flex, I have a trigger that uses Incoming Message transition to send the data to a Send To Flex Widget, I can see in the logs that its able to get the message, however when it tries to direct the message data to Flex, I see the following error in the logs.
Note that I'm using the Programmable Chat Channel in the Send To Flex Widget
LOG
Send interaction to Flex via TaskRouter
DETAIL
SendToFlexWidget is not supported for this channel/trigger combination
I'd appreciate any help, Thanks.
I had the exact same situation when I was first setting up a new Flex Project. Turns out I had not registered the phone number with the project. From the console Flex>Messaging

how to hide my twilio number from receiver when sending response

I am developing an app in android which send messages to users. I am using php for my api. when user send a message from the app, php sends back a response based on what they send.
Is there a way I can hide the twilio number from been known to the users or convert the number to a string when sending back response to the user?
Can you elaborate on what you're trying to accomplish?
If preventing the user from seeing the actual phone number, you could look at Twilio's Proxy service (in Beta). https://www.twilio.com/docs/proxy/api
Another option would be to register a short code with the phone number. https://www.twilio.com/docs/glossary/what-is-a-short-code

Send mass texts with iOS

Is there anyway to send the same text to multiple contacts not as a group text. I have been told that it would need a server to accomplish this. If that is the case I would like to be able to still send texts from my current number not a new number. I have checked out Twilio but have not gotten very far.
Twilio developer evangelist here.
You cannot send mass text messages using Twilio and your existing phone number.
One option you might have is, if you have a Mac you can control the SMS app programmatically to send lots of SMS messages. Here's a blog post with some example code to do that: https://www.twilio.com/blog/2017/06/drawing-pixel-art-text-messages-signal-video-wall.html
That might not be of much help, but while you can send lots of SMS messages with Twilio, you cannot do so using your existing number.
Yes you could send mass texts out to different numbers using twilio. No you could not use your current number.
You would have to purchase a new twilio number that has SMS messaging enabled.
Look at the Twilio documentation and their get started guide, figure out the language you want to create your server in and you will be sending texts in no time. https://www.twilio.com/docs/quickstart/node/programmable-sms You would run the webserver. Twilio does not offer a swift or ios based SMS solution.
https://www.twilio.com/docs/quickstart?filter-language=swift

Alexa sending SMS text Messages

I am looking for any sort of iPhone function for sending messages that can be accessed by an Alexa skill that is able to send SMS text messages, as well as read SMS text messages of a user. I know that these skills are already present, however, I am looking to do this in combination with numerous other features which I have already finished.
Any help would be much appreciated. Thanks!
Alex Skills normally run as Amazon Lambda functions. Lambda functions can call other AWS services (from the cloud, not from the phone).
Amazon SNS can send an SMS message. Here is an example using the AWS Command-Line Interface (CLI):
aws sns publish --phone-number +XXXX --message "Hello!"
However, if you are looking to send messages from the phone itself, or read messages that are already on the phone, then you will need to write an iPhone app than can use the iOS APIs to send/receive messages. This would not, however, be an 'Alex Skill' since it is running on the phone.

Resources