MetaTrader 5: Publishing trading forecasts and live trading statements via e-mail on blogs, social networks and dedicated websites

investeo | 6 May, 2010

Introduction

Automatic web-publication of trading forecasts has become a widespread trend in the trading industry. Some traders or companies use Internet as a medium for selling subscribed signals, some traders use it for their own blogs to inform about their track record, some do it in order to offer programming or consultancy services. Others publish signals just for fame or fun.

This article aims to present ready-made solutions for publishing forecasts using MetaTrader 5. It covers a range of ideas: from using dedicated websites for publishing MetaTrader statements, through setting up one's own website with virtually no web programming experience needed and finally integration with a social network microblogging service that allows many readers to join and follow the forecasts.

All solutions presented here are 100% free and possible to setup by anyone with a basic knowledge of e-mail and ftp services. There are no obstacles to use the same techniques for professional hosting and commercial trading forecast services.

1. Configuring MetaTrader 5 for E-Mail

1.1. Step 1: Creating an external e-mail account

In order to publish an automatic trading forecast from MetaTrader one has to setup an external e-mail account. For the purpose of this article one the biggest and widely known e-mail providers was chosen: Google's Gmail. The author assumes that a reader does not need to have a Gmail's account yet, therefore a quick step-by-step tutorial follows.

In order to create Gmail's account one has to point the web browser to http://gmail.com and press ''Create and account'' button:

Fig. 1 Create an account button at gmail.com

Google asks for data to fill in: First Name, Last Name, Desired Login Name, password and a security question in case the password was lost.


Fig. 2 Create an account form

After CAPTCHA verification and agreeing to Terms of Service, the account is created. One should be immediately able to access the account.

The article will use mql5signals@gmail.com as the base e-mail address. The address has been setup for educational purposes only and does not aim to offer any real trading forecasts.

In order to check and verify the account, one can enter credentials and password using the web browser.

There should be a few welcome messages available.

Fig. 3 Welcome messages from gmail.com

After setting up the Gmail's account it is high time to integrate it with MetaTrader 5.

1.2. Step 2: Configuring E-Mail in MetaTrader 5

After launching MetaTrader 5 plase make sure that the terminal is properly connected and synchronized. Journal in Toolbox window should contain lines similar to the ones below:

2010.04.26 21:49:38 Network '80360': terminal synchronized with MetaQuotes Software Corp.

2010.04.26 21:49:38 Network '80360': authorized on MetaQuotes-Demo

After making sure the terminal is connected, please press CTRL+O or choose Tools->Options Menu. A popup dialog should appear:

Fig. 4 Options dialog

The Email tab contains e-mail settings that need to be inserted in appropriate fields:

Fig. 5 Email configuration tab

Enable checkbox tells Metatrader to enable Email settings. The following fields in the dialog box should contain:

  1. SMTP server: smtp.gmail.com – a default SMTP server provided by Google for sending e-mail messages

  2. SMTP login: mql5signals@gmail.com – please enter your own account login in form of myforexsignal@gmail.com, or any other if you use different E-mail provider

  3. SMTP password: this is the password setup earlier for this Gmail's account

  4. From: mql5signals@gmail.com – this field contains the address of the sender

  5. To: mql5signals@gmail.com – this field contains the address of the recipient.

In order to try out the settings press 'Test' button in Options Dialog. If connection is successful, two things should happen:

In journal there should appear a line similar to:

2010.04.26 23:17:50 MailDispatcher send e-mail complete 'MetaTrader SendMail Test'

and you should receive an email from MetaTrader to Gmail account:

subject: MetaTrader SendMail Test

from: mql5signals@gmail.com

to: mql5signals@gmail.com

date: Mon, Apr 26, 2010 at 11:17 PM

MetaTrader SendMail test message body

If this works, you will be able to send e-mail messages from MetaTrader 5 via Gmail's SMTP server to any e-mail address in the world.

This means e.g. trading forecasts or any other information.

In order to send a message from MQL5 code to a chosen recipient, one could use SendMail function. The simple usage is in the script below. You could insert the SendMail function inside Expert Advisor that would trigger sending an e-mail each time a signal is generated.

This setup can also be used to send signals as new posts to a website, be it a commercial solution or based on blogging platforms. It will be presented later in the article.

//+------------------------------------------------------------------+
//|                                                     SendMail.mq5 |
//|                                      Copyright 2010, Investeo.pl |
//|                                                      Investeo.pl |
//+------------------------------------------------------------------+
#property copyright "2010, Investeo"
#property link      "http://Investeo.pl"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Script program start function                                    |
//+------------------------------------------------------------------+
void OnStart()
  {
//---
   if (SendMail("MQL5Script", "E-MAIL from MQL5")==false)
      Print(GetLastError());
   else Print("E-mail sent.");
   
  }
//+------------------------------------------------------------------+

2. Dedicated websites for publishing live MetaTrader statements

In recent years due to high demand there has developed a new breed of services that offer storing, analyzing, publishing and storing MetaTrader's trading statements. The services are constantly improving and and very good add-on to our trading log, as they allow highly detailed analysis of profits and losses on our accounts.

An example of such a website I found that is already working with MetaTrader 5 is MT Intellingence: http://mt4i.com. Publishing of a report is possible either via MetaTrader's FTP service or using Publisher EA, (during time of writing the article the latter option is available only for MetaTrader 4).

In order to publish own statements one has to create an account on MT Intelligence website and enter appropriate FTP settings into MetaTrader.

The integration process involves entering MT Intelligence FTP server, login, password and account numbers into Options->Publisher dialog:

Fig. 6 Publisher configuration tab

If connection is setup correctly, MetaTrader will send updated statement via File Transfer Protocol every nth minute to MT Intelligence website.

The statement should be visible after login to http://mt4i.com:


Fig. 7 Trading statement

The complete example of a sample report can be found at http://www.mt4i.com/users/mql5signals

MT Intelligence also provides widgets that can be incorporated into our own website. The widgets contain important information about profits, winning, losing positions and many other highly customized reports.

Fig. 8 Daily cumulative net profit for each symbol/direction (generated by MT Intelligence website)

Fig. 9 Daily net banked profit/loss  (generated by MT Intelligence website)

Fig. 10 Number of winning and losing positions banked per symbol (generated by MT Intelligence website)

 

Fig. 11 Number of closed positions per symbol (generated by MT Intelligence website)

One of the nice thing offered by mt4i is RSS service that contains live account summary and lists all open orders:

Fig. 12 Open and recent orders for mql5signals (published by MT Intelligence website)

The MT Intelligence site is presented as an example.

Also two more services are worth looking at: http://mt4live.com and http://mt4stats.com. I strongly believe that both will provide support for MetaTrader 5 or develop their MT5 equivalents http://mt5live.com or http://mt5stats.com.

3. Publishing forecasts on websites using two best blogging platforms: WordPress and Google's Blogger.

Blogging has become a point of interest to many people all over the world in recent years. Nowadays hobbyists do it, companies do it, professionals do it, politicitians including presidents do it, and guess who - yes, traders also do blog. There are numerous pros and cons of blogging, but this is not the point in this article.

The great thing is that we can incorporate automatic trading signals from MT5 straight into our websites. The article will present how to setup the preinstalled platforms: Google's Blogger and Wordpress and integrate it with MetaTrader 5 for trading forecasts.

3.1. Google's Blogger

First blogging platform described is Google's Blogger. It is already integrated with Gmail's account, therefore the same e-mail and password as for Gmail are used. In order to sign in one needs to point the web browser to http://blogger.com and enter Gmail's  e-mail address and password.

Fig. 13 Blogger welcome screen

After signing in in order to create a blog, one should click to  'Create your blog now' button:

Fig. 14 Create Blogger account button

The blog address must be unique, therefore it is necessary to check if the name has not yet been taken:

Fig. 15 Checking unique blog name at Blogger

If everything was done correctly, the new blog should be created in seconds:

Fig. 16 Blogger account created message

In order to integrate our blog and MetaTrader 5 we need to setup automatic posts publishing via e-mail.

This will allow MetaTrader 5 to send the automatic trade forecasts and instantly publish them as a new post on the blog. The e-mail address must be kept secret, so that nobody else can post unwanted posts apart from the owner of the blog.

The E-mail publishing is done in Settings Tab under "Email & Mobile" section:


Fig. 17 Mail2Blogger configuration

After the address is been set up, it is possible to send forecasts using MQL SendMail function, as presented earlier in the article.

The example blog can be found at http://mql5signals.blogspot.com:

Fig. 18 Blog at mql5signals.blogspot.com

3.2. WordPress

The alternative blogging platform to Blogger is WordPress. Wordpress also provides a possibility to add automatic posts insertion via e-mail. Apart from WordPress.com hosting it is possible to download and fully customize the platform on one's own web server.

The process of blog creation on http://WordPress.com is also simple as in Blogger's case and takes only a few minutes.

In order to create a blog, point the web browser to http://wordpress.com/signup/ and enter your credentials.


Fig. 19 Creating an account at Wordpress.com

Similarily to Blogger, blog's address must be unique, therefore the domain for the blog must be confirmed.

Fig. 20 Checking unique blog name at Wordpress.com

After the account is set up, the activation e-mail is sent and confirmation is requested.

Fig. 21 Confirmation e-mail notice

Upon confirming the activation e-mail account becomes active and we are ready to begin with configuration.

Fig. 22 Account activation message

Hint: Login link is always in form of http://www.yourdomain.com/wp-login.php, or simply http://www.yourdomain.com/login. Since the blog is on WordPress.com domain, you can click on the login link above or point the web browser to address http://yourdomain.wordpress.com/login.

The article uses http://mql5signals.wordpress.com/login as an example.

Fig. 23 Login to Wordpress blog

The first thing you should notice after login is a panel located on the left sidebar. As we are interested in MetaTrader 5 integration, please go to Settings->Writing menu.

Fig. 24 Wordpress setings panel

As you can see below, similarily to Blogger there is 'Post by Email' functionality incorporated into Wordpress. It can be set up by clicking on My Blogs hyperlink

Fig. 25 Post by email setting

In My Blogs menu, after clicking on 'Enable' button and enabling 'Post by Email' functionality, a unique random secret e-mail address is generated. This is the address that MetaTrader will send e-mails to.

The Configuration is identical as in Blogger's case.


   

Fig. 26 Before activating Post by E-mail


  

Fig. 27 Post by E-mail activated

Now you should have fully integrated Wordpress blog to MetaTrader 5.

The example http://mql5signals.wordpress.com is up and running:

Fig. 28 Blog at mql5signals.wordpress.com

This is it - we setup two blogs that are integrated with MetaTrader 5. 

The great thing this is that we can use some plugins or widget provided by other vendors e.g. http://mt4i.com straight into our blog and enhance our website capabilities!

The html codes needed to insert appropriate widgets are available on vendors' websites. Feel free to add them by yourself and play around with the ones that suit you.

4. Integration with Twitter, a microblogging service than many people can follow


Fig. 29 Twitter's logo

The shortest description for Twitter is a short message broadcast service. Any person can be a source of information as well as a destination for it. People following entries of other persons are called 'followers'. Millions of people use it on a daily basis to communicate with a given group of people. For some time it was used only by individuals, but it becomes a news source also for companies.

If you are interested in more details, please visit http://business.twitter.com/twitter101/ for more information on bussiness related usage of tweeter.

In order to signup for tweeter account, please point your browser to http://twitter.com/signup. The registration process is very straightforward and similar to those of Wordpress account. For the purpose of this article, a http://twitter.com/mql5signals account was created. 

Suppose you would like to inform a group of followers on a trading signal. The trading signal would be posted on a Wordpress-based website. The solution is to integrate Wordpress with Twitter, thankfully it can be done in a few steps. Please login to your Wordpress website http://yourdomain.wordpress.com/login, in my case http://mql5signals.wordpress.com/login.

The same settings page we used for E-mail integration has 'Publicize' options available and one of them is 'Twitter'. Please check this option and press 'Publicize' button.


Fig. 30 Wordpress publicize option

Wordpress will ask for authorization of Twitter account, please confirm it by clicking 'Authorize connection with Twitter'.

Fig. 31 Twitter's account authorization at Wordpress

Then the Twitter message will pop up asking for your Twitter's username or Email and a password:


Fig. 32 Connecting Wordpress to Twitter

If nothing went wrong Wordpress and Twitter are synchronized. Each time a new post is added (e.g. a forecast from MetaTrader 5 is sent), Twitter gets updated in seconds giving the direct hyperlink to the new post.


Fig. 33 Published Twitter message

This is it , we have fully integrated Twitter!

You may check http://twitter.com/mql5signals to see the example Twitter used for this article.

Conclusion

After reading the article you should be equipped with a knowledge on how to publish automated trading forecasts using MetaTrader and ways to present the forecasts to the end user.

You should be able to setup Gmail's account, integrate it with MetaTrader, you should know where to publish MetaTrader statements, how to configure and integrate Google's Blogger or Wordpress blogging platform with MetaTrader and how to integrate Twitter with Wordpress.

The doors are open now and the rest is totally upon you to decide what kind of service you need and what to publish.

Have fun!