Methods to autotrade signals from emails only

Discussion in 'Automated Trading' started by Temjin, Mar 29, 2020.

  1. Turveyd

    Turveyd

    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.
     
    #11     Mar 29, 2020
  2. 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.
     
    #12     Mar 29, 2020
  3. Temjin

    Temjin

    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.
     
    #13     Mar 30, 2020
  4. Turveyd

    Turveyd

    Pretty sure I sure in MT4 it had basic read and write to text files so I'd say yes.
     
    #14     Mar 30, 2020
  5. Turveyd

    Turveyd

    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
     
    #15     Mar 30, 2020
  6. Temjin

    Temjin

    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.
     
    #16     Mar 30, 2020
  7. Temjin

    Temjin

    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.
     
    #17     Mar 30, 2020
  8. Turveyd

    Turveyd

    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.
     
    #18     Mar 30, 2020
  9. 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: Apr 1, 2020
    #19     Apr 1, 2020
  10. Temjin

    Temjin

    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.
     
    #20     Apr 12, 2020