Methods to autotrade signals from emails only

VB6 can easily interface with Outlook, so as long as Outlook is running, VB6 can check for emails every 1 second and send info via the csv file.

I've done similar before, can't see it on my PC ( 3 years ago, project got canceled ) I'll check my laptop see if it's still hanging around on there.

Then MT5 can check every time the price changes and hey presto.
 
Thanks. I will be using the email parser service to read and process the emails for me.

My concern about that link is that the github repo is 2-3 years old ... does the code still work with modern gmail? But, if you have a reliable way to get the email to a .txt file, what I would do (given my background and setup) is write a python script that checks the folder with email files every X seconds/minutes, imports new files and stores as a list (or pandas dataframe), do the parsing in python with regular expressions, then append results to a CSV file. MT5 can then use that file (I don't use MT5, so I'm not sure about the mechanism there.

A programmer could put this together fairly easily. But again, the devil is in the details; here, that detail is the bridge between your email and python.
 
VB6 can easily interface with Outlook, so as long as Outlook is running, VB6 can check for emails every 1 second and send info via the csv file.

I've done similar before, can't see it on my PC ( 3 years ago, project got canceled ) I'll check my laptop see if it's still hanging around on there.

Then MT5 can check every time the price changes and hey presto.

Thanks. I'm more interested to know if MT5 can indeed trade such signals from update of TXT files.

Another solution I'm looking at is Microsoft Flow to parser the emails.
 
Thanks. I'm more interested to know if MT5 can indeed trade such signals from update of TXT files.

Another solution I'm looking at is Microsoft Flow to parser the emails.

Pretty sure I sure in MT4 it had basic read and write to text files so I'd say yes.
 
MT4 Confirms, won't take stuff away for MT5 be similar / same.

FileOpen

The function opens the file with the specified name and flag.

int FileOpen(
stringfile_name, // File name
intopen_flags, // Combination of flags
shortdelimiter=';', // Delimiter
uintcodepage=CP_ACP// Code page
);

Parameters

file_name

[in] The name of the file can contain subfolders. If the file is opened for writing, these subfolders will be created if there are no such ones.

open_flags

[in] combination of flags determining the operation mode for the file. The flags are defined as follows:
FILE_READ file is opened for reading
FILE_WRITE file is opened for writing
FILE_BIN binary read-write mode (no conversion from a string and to a string)
FILE_CSV file of csv type (all recorded items are converted to the strings of unicode or ansi type, and are separated by a delimiter)
FILE_TXT a simple text file (the same as csv, but the delimiter is not taken into account)
FILE_ANSI lines of ANSI type (single-byte symbols)
FILE_UNICODE lines of UNICODE type (double-byte characters)
FILE_SHARE_READ shared reading from several programs
FILE_SHARE_WRITE shared writing from several programs
FILE_COMMON location of the file in a shared folder for all client terminals \Terminal\Common\Files
 
Pretty sure I sure in MT4 it had basic read and write to text files so I'd say yes.

Thanks and on the below. I read the guides for MT5 (need to track stock, not forex) and it does have the read file functionality as well.

Just need to find a reputable programmer to help me to write the EA for it.
 
VB6 can easily interface with Outlook, so as long as Outlook is running, VB6 can check for emails every 1 second and send info via the csv file.

I've done similar before, can't see it on my PC ( 3 years ago, project got canceled ) I'll check my laptop see if it's still hanging around on there.

Then MT5 can check every time the price changes and hey presto.

Hmm...that's definitely one pathway too. Basically act as the email parser.

My concern about that link is that the github repo is 2-3 years old ... does the code still work with modern gmail? But, if you have a reliable way to get the email to a .txt file, what I would do (given my background and setup) is write a python script that checks the folder with email files every X seconds/minutes, imports new files and stores as a list (or pandas dataframe), do the parsing in python with regular expressions, then append results to a CSV file. MT5 can then use that file (I don't use MT5, so I'm not sure about the mechanism there.

A programmer could put this together fairly easily. But again, the devil is in the details; here, that detail is the bridge between your email and python.

Thanks. Just as above, it's between email and python to the CSV file. I've done a bit more research now and will either use an email parser service or try Microsoft Flow to parser it. Don't really want to write, or get someone to, custom code to do this.

But in all, it seems using the CSV/TXT file within MT5 or Ninjatrader is the way to go for now.
 
Hmm...that's definitely one pathway too. Basically act as the email parser.



Thanks. Just as above, it's between email and python to the CSV file. I've done a bit more research now and will either use an email parser service or try Microsoft Flow to parser it. Don't really want to write, or get someone to, custom code to do this.

But in all, it seems using the CSV/TXT file within MT5 or Ninjatrader is the way to go for now.

I'll switch on laptop and post the email reading code via VB6 it's only small from memory, just got to write the logic to understand your email then, keep the email simple and should be easy.
 
Hello all,

Trying to seek some advice on the most simplistic approach in achieving the automated trading of buy/sell signals for STOCK ONLY received from emails only.

The emails always come with a subject title that includes a STOCK SYMBOL and a BUY or SELL signal only. There is no stop price, no target profit, trailing profit, position-sizing recommendation, nothing. A position is always closed within a few days. Speed is critical but not to the second. (a minute or two delay wouldn't hurt)

This is my current thinking of how the signal email reaches the broker at the moment.

Signal Email -> Email Parser -> Automated Trading Software (VPN hosted) -> Broker (Interactive Broker)

Note: I've looked at Collective2 but it isn't feasible. Firstly, the signal provider isn't subscribed to it, and secondly, Collective2's functionality is quite limited. (including their custom email signal function)

The difficult part, at least in my opinion, is from the email parser to the trading software. I am leaning toward the use of MetaTrader 5, but know there are a number of other options out there including custom API coding on IB's own trading software. However, I prefer the simplistic solution to get it up and running as soon as possible to test out the feasibility of it.

I can only do basic coding, and therefore, have to rely on contracting a programmer to assist me with it.

If using MetaTrader 5, I am not 100% sure if there is a way to convert email signal into trading signals within the software. I understand there is a way to update a "csv" file that can be read/edit by MT5, so the email parser service can possibly update that csv file when the signal comes.

Otherwise, it would be great to get some ideas on how to achieve this.

Thank you all!

I can easily do this using my custom Mac OS desktop controlling a NinjaTrader instance running in a Virtual Machine, using the Order Instruction File interface. Trust me that file interface is no easy thing to understand.
I recently developed my own automated trading system this way. It might be overkill to you but I have no limitations in what it can do with my setup. You just need a slave computer to be running at all times(during trading hours). You can talk to me privately if you like, I am Swift language expert and have worked on developing on iOS and Mac for many years.
 
Last edited:
I can easily do this using my custom Mac OS desktop controlling a NinjaTrader instance running in a Virtual Machine, using the Order Instruction File interface. Trust me that file interface is no easy thing to understand.
I recently developed my own automated trading system this way. It might be overkill to you but I have no limitations in what it can do with my setup. You just need a slave computer to be running at all times(during trading hours). You can talk to me privately if you like, I am Swift language expert and have worked on developing on iOS and Mac for many years.

Thanks and for everyone else response, soz for not posting back.

But I've got the problem solved, at least I think so based on the progress I'm making so far.

The setup would be like this,

Email -> Microsoft Power Automate for parsing -> Save csv to dropbox -> IBridgePY via Python for the automated trading code and read csv as the signal -> Interactive Brokers

All be on Amazon EC2, but still looking for other alternatives. Still have to figure out dropbox integration on these virtual hosting, but I think it should be fine.

IBridgePy works quite well so far, and Python is just easy to use as I had previous R coding experiences.
 
Back
Top