Automated journaling with MQL4 and Evernote.

Keeping a journal in Evernote is something that has been drummed into me by my trading mentors. I trade automatically for the most part now, but I still want to know what has affected the markets and how my algorithms are doing. Although it’s simple enough to plug MT4 into MyFXBook or similar, it’s nice to be able to put together your own notes. In this example I’ll show you how to create a basic note using MQL4, though similar concepts will work in other systems that support emailing.

What you’ll need…

  • Your Evernote email address, which I’ll explain how to find shortly.
  • MT4 (for this example, you can do something similar in any other trading software that supports emailing).
  • Some basic MQL4 knowledge.

My Evernote email address; What’s that?

Evernote allows you to push notes to your journal via email, although this very useful feature isn’t particularly well advertised in my opinion. To find your Evernote email address, you’ll need to log into your account at Evernote.com. Once you’ve done that, you’ll see your username displayed in the top-left corner of the screen. Click it, and you’ll see the account menu. Once you’ve done this, you’ll see a menu like the one in the picture. Click on Settings.

Once the settings page loads, scroll to the bottom of the page, where you’ll see something similar to this:

Don’t fall into the trap of getting confused between the two email addresses. The one you need for this is at the bottom. Copy this to your clipboard.

Pro tip: Do you receive a weekly events calendar or some other email that you use as part of your preparations? Save yourself some time and redirect/forward that email there too.

Setting up MT4…

 The next step is to set up MT4 for emailing. Open up the software, click Tools and then click Options (or press CTRL + O). When the Options box appears, click on the Email tab. Once you’ve done that, you should see something like this:

Fill in the details (you can find your provider’s SMTP details with Google). Once you’ve done that, send a test email by clicking the Test button. If your message was sent successfully, you’ll see something like this:

A simple note such as the one shown will appear in your notebook:

Great. Now that you’ve gotten this far, you’re ready to think about how you could apply something like this to your Expert Advisors. 

How can I use this in my Experts?

Open up the MetaQuotes Editor by clicking the icon or pressing F4 in MT4. Create a new EA (or open an existing one). In the OnStart section of the boilerplate, add the following code:

void OnStart ( ) {

SendMail ( "MT4", "I just sent a note to Evernote from MT4." );

}

When the Expert Advisor runs, your email will be sent. Well done!

Where can I go from here?

This example has hopefully taught you how to send a basic note from a MT4 Expert Advisor to Evernote. You have set up your Evernote email address and sent a simple line of text to the notebook. From here you can add data calculated or returned from your EA or, as I do, set it up to post at certain specific times. Good luck.