Download MetaTrader 5

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

6 May 2010, 10:01
investeo
8
16 497

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!

Last comments | Go to discussion (8)
blueyes
blueyes | 27 Aug 2011 at 18:17

I modified the configuration of the field "SMTP server" with the value smtp.gmail.com:465 => it works perfectly now.

Blueyes 

Liping Wang
Liping Wang | 19 Sep 2012 at 23:12

This article helps, thank you!

tonymaccaroni
tonymaccaroni | 24 Sep 2012 at 17:32

thanks! great help!
Balachandran Chandrasekar
Balachandran Chandrasekar | 18 Feb 2014 at 14:55
How to read from blog and display in terminal ?
Sergey Golubev
Sergey Golubev | 6 Jun 2014 at 21:48

Forum on trading, automated trading systems and testing trading strategies

Discussion of article "Time Series Forecasting Using Exponential Smoothing"

newdigital, 2014.06.06 21:48

Becoming a Fearless Forex Trader

  • Must You Know What Will Happen Next?
  • Is There a Better Way?
  • Strategies When You Know That You Don’t Know
“Good investing is a peculiar balance between the conviction to follow your ideas and the flexibility to recognize when you have made a mistake.”
-Michael Steinhardt


"95% of the trading errors you are likely to make will stem from your attitudes about being wrong, losing money, missing out, and leaving money on the table – the four trading fears"
-Mark Douglas, Trading In the Zone


Many traders become enamored with the idea of forecasting. The need for forecasting seems to be inherent to successful trading. After all, you reason, I must know what will happen next in order to make money, right? Thankfully, that’s not right and this article will break down how you can trade well without knowing what will happen next.



Must You Know What Will Happen Next?

While knowing what would happen next would be helpful, no one can know for sure. The reason that insider trading is a crime that is often tested in equity markets can help you see that some traders are so desperate to know the future that their willing to cheat and pay a stiff fine when caught. In short, it’s dangerous to think in terms of a certain future when your money is on the line and best to think of edges over certainties when taking a trade.



The problem with thinking that you must know what the future holds for your trade, is that when something adverse happens to your trade from your expectations, fear sets in. Fear in and of itself isn’t bad. However, most traders with their money on the line, will often freeze and fail to close out the trade.

If you don’t need to know what will happen next, what do you need? The list is surprisingly short and simple but what’s more important is that you don’t think you know what will happen because if you do, you’ll likely overleverage and downplay the risks which are ever-present in the world of trading.
  • A Clean Edge That You’re Comfortable Entering A Trade On
  • A Well Defined Invalidation Point Where Your Trade Set-Up No Longer
  • A Potential Reversal Entry Point
  • An Appropriate Trade Size / Money Management
Is There a Better Way?

Yesterday, the European Central Bank decided to cut their refi rate and deposit rate. Many traders went into this meeting short, yet EURUSD covered ~250% of its daily ATR range and closed near the highs, indicating EURUSD strength. Simply put, the outcome was outside of most trader’s realm of possibility and if you went short and were struck by fear, you likely did not close out that short and were another “victim of the market”, which is another way of saying a victim of your own fears of losing.



So what is the better way? Believe it or not, it’s to approach the market, understanding how emotional markets can be and that it is best not to get tied up in the direction the market “has to go”. Many traders will hold on to a losing trade, not to the benefit of their account, but rather to protect their ego. Of course, the better path to trading is to focus on protecting your account equity and leaving your ego at the door of your trading room so that it does not affect your trading negatively.

Strategies When You Know That You Don’t Know

There is one commonality with traders who can trade without fear. They build losing trades into their approach. It’s similar to a gambit in chess and it takes away the edge and strong-hold that fear has on many traders. For those non-chess players, a gambit is a play in which you sacrifice a low-value piece, like a pawn, for the sake of gaining an advantage. In trading, the gambit could be your first trade that allows you to get a better taste of the edge you’re sensing at the moment the trade is entered.


James Stanley’s USD Hedge is a great example of a strategy that works under the assumption that one trade will be a loser. What’s the significance of this? It pre-assumes the loss and will allow you to trade without the fear that plagues so many traders. Another tool that you can use to help you define if the trend is staying in your favor or going against you is a fractal.

If you look outside of the world of trading and chess, there are other businesses that presume a loss and therefore are able to act with a clear head when a loss comes. Those businesses are casinos and insurance companies. Both of these businesses presume a loss and work only in line with a calculated risk, they operate free of fear and you can as well if you presume small losses as part of your strategy.

Another great Mark Douglas quote:
“The less I cared about whether or not I was wrong, the clearer things became, making it much easier to move in and out of positions, cutting my losses short to make myself mentally available to take the next opportunity.” -Mark Douglas

Happy Trading!

The source


Step on New Rails: Custom Indicators in MQL5 Step on New Rails: Custom Indicators in MQL5

I will not list all of the new possibilities and features of the new terminal and language. They are numerous, and some novelties are worth the discussion in a separate article. Also there is no code here, written with object-oriented programming, it is a too serous topic to be simply mentioned in a context as additional advantages for developers. In this article we will consider the indicators, their structure, drawing, types and their programming details, as compared to MQL4. I hope that this article will be useful both for beginners and experienced developers, maybe some of them will find something new.

Here Comes the New MetaTrader 5 and MQL5 Here Comes the New MetaTrader 5 and MQL5

This is just a brief review of MetaTrader 5. I can't describe all the system's new features for such a short time period - the testing started on 2009.09.09. This is a symbolical date, and I am sure it will be a lucky number. A few days have passed since I got the beta version of the MetaTrader 5 terminal and MQL5. I haven't managed to try all its features, but I am already impressed.

False trigger protection for Trading Robot False trigger protection for Trading Robot

Profitability of trading systems is defined not only by logic and precision of analyzing the financial instrument dynamics, but also by the quality of the performance algorithm of this logic. False trigger is typical for low quality performance of the main logic of a trading robot. Ways of solving the specified problem are considered in this article.

Using text files for storing input parameters of Expert Advisors, indicators and scripts Using text files for storing input parameters of Expert Advisors, indicators and scripts

The article describes the application of text files for storing dynamic objects, arrays and other variables used as properties of Expert Advisors, indicators and scripts. The files serve as a convenient addition to the functionality of standard tools offered by MQL languages.