Forex Blog

First-hand Forex trading experience and information about foreign exchange market that will be useful to traders

Archives

Price Alert Indicator Conversion to MT5

October 27, 2009 by Andriy Moraru

I converted my second MT4 indicator MT5 today. It’s Price Alert. I’ve created and published its MT4 version on April 27th this year. This time it was much easier to convert from MQL4 to MQL5 language (compared to my first experience). There were two main differences between MQL4 and MQL5 this time:

  1. In MT5 objects can be created in different chart windows, so now it’s necessary to specify which chart window you want to place the object (horizontal lines in case of Price Alert indicator).
  2. The input parameters can’t be modified inside the code of an indicator. Actually, that’s a very good thing that won’t allow coders to mess up with the input parameters. But to convert Price Alert I had to create the additional internal variables to preserve the functionality of the MT4 version of this indicator.

Additionally, I’ve updated both versions (MT4 and MT5) of Price Alert with the capability to send e-mails with the price alert. To turn it on you first have to configure your MT4/MT5 platform (Tools->Options->Email) and then set the value of the indicator’s input parameter SendEmail to “true”.

You can see the code of MT5 version or read more info about it.

If you find some bugs in this Price Alert MT5 indicator or want to make a suggestion regarding its functionality, please, use the commentary form below.

Leave a Reply

required
required (will not be published)
optional