Methods to autotrade signals from emails only

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

  1. Temjin

    Temjin

    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!
     
  2. tommcginnis

    tommcginnis

    In a sentence, you are looking for an email-reading interface, between a signal generator's emails, and (presumably) a broker's API to their/your direct-market-access account?

    You wish to take received emails as instructions to a trading/market interface, yes?

    FWIW, the instructions would be trivial, but having identification/security in the reader would be paramount, before any instruction was even contemplated.
     
    Sekiyo likes this.
  3. Interesting challenge. Email is tricky, because there’s so many protocols to consider. Do you have access to those messages as files on your system? What protocol do you use to receive those emails? What software stores them?

    Or: where do those emails come from? Maybe tapping into the source — e.g., a twitter account — may be easier.
     
  4. FrankInLa

    FrankInLa

    https://stackoverflow.com/questions/7056715/reading-emails-from-gmail-in-c-sharp

     
  5. Temjin

    Temjin

    Correct on the above.

    My idea is that the TRADING SOFTWARE, i.e. MetaTrader 5, will provide all the necessary position sizing functionality and identification and management of MULTIPLE positions for me. (several positions can be open at any one time) Is the latter what you mean by having "identification/security in the reader"?

    The emails as instructions would only be limited to a STOCK SYMBOL in which to either BUY or SELL.

    Thanks!
     
  6. Temjin

    Temjin

    Nope. The signal provider will not convert it to ANY OTHER format and I only have access to them via emails only. No SMS, no twitter, etc. But they come in a consistent format, at least in the email subject title which will always contain the stock symbol and to buy or sell with a recommended price. (for price, it wouldn't matter as much as the stock would surely move from it before you can execute in time. (subscribers do it manually, I want to do it automatically)

    Yeah, my dilemma is the many protocols to consider. I'm really looking for the most simple one to use. Efficiency (i.e. direct interface) isn't high on my list atm.

    Thanks too!
     
  7. Temjin

    Temjin

    I also understand Ninjatrade has an Order Instruction File interface for automated trading. Similar to MT5's ability to read and trade from a CSV file. Just not sure which is simpler to use and with easier access to external help for programming.
     
  8. So how do you receive the email? What format are messages stored in on your system?

    Once you have the file, it’ll be fairly simple to update a csv. You can import to python and use the pandas library, or do it directly in the Unix shell via grep.
     
  9. Temjin

    Temjin

    To any email inbox. That is why I believe the email parser service (receive the signal email and convert it to a text file somewhere) is an important part of the interface.

    Heh Coding newbie here. :) That is why I'm asking for the simplistic method to achieve this. E.g. EA created in MT5 to read the csv file and trade as they come in constantly.

    I am just wondering what other methods I can use besides the above. Fastest and simplest to deploy.
     
  10. Temjin

    Temjin

    #10     Mar 29, 2020