FX Blue Alert Forwarder for MT4 - User guide

The Alert Forwarder adds email, SMS, Twitter, and push-notification alerts to MT4 EAs and indicators which do not offer this themselves. For example, if an EA or indicator generates an alert on screen then the Alert Forwarder can turn it into an email or a push notification.

1Overview

The main purpose of the Alert Forwarder is to add email, SMS, Twitter, and push-notification alerts to MT4 EAs and indicators which do not offer this themselves. For example, if an EA or indicator generates an alert on screen then the Alert Forwarder can turn it into an email or a push notification.

The Alert Forwarder scans the MT4 Experts log, looking for entries which match the conditions you give it, and sends out any matching log entries via your choice of email, SMS etc.

The app can also be used to scan the MT4 Journal, generating alerts about events such as disconnections or failed orders.

In addition, the app can be configured to take screenshots of its chart when an event is detected, allowing later diagnosis of problems, inspection of trade set-ups etc. For example, you can use it to take a screenshot of an indicator's chart whenever that indicator writes a particular entry to the MT4 logs.

1.1Licence

Unless otherwise specified in writing by FX Blue, this software is licensed for personal use only. You are not allowed to distribute it to other people, regardless of whether or not money is changing hands. You only have a licence to use the software if you, personally, downloaded it from our website.

The software is provided entirely at the user's risk, and you should check it thoroughly before deploying it on computers trading real money. FX Blue accepts no responsibility whatsoever for any loss of any kind caused by installation or use of the software.

2.1Adding the Alert Forwarder to a chart

The Alert Forwarder is an indicator (not an EA or script). You run the Alert Forwarder by adding the indicator to any chart. It does not have to be on the same chart as an EA which you want it to monitor, unless you want to take screenshots.

You can run multiple copies of the Alert Forwarder, to look for different events in the logs. These indicators can all be on the same chart or on different charts.

You control the settings for the Alert Forwarder using the Inputs tab when adding the indicator to its chart. You must specify some text to search for, and you must turn on at least one of the notification options such as email, SMS etc.

You must turn on the "Allow DLL imports" setting when adding the indicator to the chart. Please note that changing the setting in Tools / Options / Expert Advisors does not affect any indicators (or EAs or scripts) which are already running; this setting is only the default which is used when you next add something to a chart.

The app will not process any entries which already exist in the logs at the time that it starts up. It only processes new log entries which happen while it is running.

For visual confirmation that the Alert Forwarder is running, you can turn on an optional status marker on the chart.

2.2Text to search for

You use the Inputs tab of the indicator to tell it which text to look for in the MT4 logs. You need to choose which log to look at - Experts or Journal - and what text to search for.

The default setting ("Alert:") will match any alerts recorded in the Experts log. However, the Alert Forwarder can be used to search for any kind of entry recorded in the log, not just alerts.

2.2.1Text searching mode

There are five types of text search which you can use. Please note that the text to search for is always case-sensitive.

Starts with: the entry in the log must start with the text you specify. (For example, all alerts in MT4 are logged starting with "Alert:").

Contains: the entry in the log must contain the text you specify.

All words: the text you specify is treated as a list of words, separated by spaces, and each individual word must be found in the log entry.

Any word: the text you specify is treated as a list of words, separated by spaces, and at least one of the words must be found in the log entry.

Exact match: the text you specify must exactly match the whole of the log entry.

2.3Filtering

The filtering settings can only be used with the Experts log, not the Journal. You can tell the Alert Forwarder only to look at items from a particular chart symbol (e.g. EURUSD), and/or a specific timeframe, and/or a specific EA or indicator name.

Please note that any chart symbol you enter must exactly match the symbol name in the platform (e.g. EURUSDcx) and any EA/indicator name must also be an exact match. Both settings are case-sensitive.

If you want to scan two (or more) different EAs/indicators, then you can simply run more than one copy of the Alert Forwarder.

2.4Emails

The Alert Forwarder can be configured to send emails via MT4's email settings (Tools / Options / Email). You need to specify the text to use as the email subject and body, which can include the variables described below.

2.5Push notifications

The Alert Forwarder can be configured to send MT4 push notifications (Tools / Options / Notifications). You need to specify the text to use for the message, which can include the variables described below. Please note that the MT4 platform has limits on how frequently you are allowed to use push notifications; messages will be rejected by MT4 if you exceed these limits.

2.6Sounds

The Alert Forwarder can play a sound whenever it finds a matching item in the log. You enter the name of the sound to play. This can be any of the sounds installed in MT4, such as disconnect, alert, news etc (see Tools / Options / Events).

2.7Pop-up alerts

The Alert Forwarder can be configured to display a pop-up alert in MT4 when it finds a matching entry in the logs. This has two main uses: generating pop-up alerts about events in the MT4 Journal such as failed trades; and turning "normal" log entries from an EA or indicator into an alert.

For example, if an EA or indicator creates a type of log entry which you think is serious, but which the EA/indicator only writes to the log without displaying an alert, then you can use the Alert Forwarder to turn this into a pop-up alert.

2.8SMS

The Alert Forwarder can generate SMS when it finds a matching entry in the logs. In order to send SMS you will need an account with Nexmo or Clickatell.

The values for settings such as SMS_param1 depend on which carrier you have signed up with.

Phone numbers should be in international format, e.g. 447879215460. You can enter multiple recipient numbers separated by commas.

2.9Twitter

The Alert Forwarder can send a tweet when it sends a matching entry in the logs.

If you turn on the Twitter functionality, you will be asked to log in to Twitter as soon as you start the Alert Forwarder. You sign in on the Twitter website and then copy and paste a PIN code for use by the app. You only need to do this once. After that, the Alert Forwarder will remember your details, and tweets will be sent immediately and automatically.

Please note that Twitter will not accept consecutive tweets with exactly the same text.

2.10Screenshots

The Alert Forwarder can be configured to take a screenshot whenever it detects a matching entry in the logs. The screenshots are stored in the MQL4\Files directory which you can find via the File / Open Data Folder menu option in MT4. Each screenshot is stored in a separate time-stamped file.

The screenshot only includes the chart on which the Alert Forwarder is running. (MT4 does not provide facilities for taking a screenshot of the entire screen or the whole of MT4). If you want to use the Alert Forwarder to take a picture of the chart activity created by a particular EA or another indicator, then you need to run the Alert Forwarder on the same chart as that EA or indicator.

By default, the screenshot will have the same width and height as the chart. You can override this using the settings in the Screenshots section of the parameters, setting them to non-zero values. You can also override the default filename for the screenshot, by setting a value which can contain text variables such a {ACC} and {TIME}.

2.11Status marker

To provide confirmation that the Alert Forwarder is running, you can optionally turn on a status marker using the settings on the Inputs tab, creating a label on the chart. You can choose the location of this marker text, and the colour.

3.1Text variables

In all the text parameters for issuing alerts, such as the email subject or SMS text, you can use the following variables:

Variable

Description

{TEXT}

The text of the matching item in the log

{ACC}

Your MT4 broker account number

{LOCALTIME}

The local time according to your computer's clock

{BROKERTIME}

The latest reported broker time

{CURR}

The symbol of your deposit currency

{BALANCE}

Your current account balance

{EQUITY}

Your current account equity

{FREEMARGIN}

Your current free margin

{MARGININUSE}

Your current margin usage

{FLOATINGPL}

Your current floating P/L

{CRLF}

Inserts a new line, for use in email

3.2SMS accounts and settings

If you want to send SMS, then you need an account with either Nexmo (www.nexmo.com) or Clickatell (www.clickatell.com). Please note that the following details are subject to change if Nexmo or Clickatell alter the layout of their websites.

3.2.1Setting up a Nexmo account

In order to send SMS via Nexmo you need to register on their site at www.nexmo.com. You will need to provide an email address (a real one!) and a mobile phone number to receive a confirmation text. This phone number does not have to be the one which you subsequently want to send alerts to.

Once you have registered, the "Api Settings" section of the Nexmo Dashboard will show you an "API key" and "API secret" for sending texts via your account with them. You then enter these values as the SMS_param1 and SMS_param2 values in the EA's configuration.

If you want to send to a US or Canadian phone number, one extra step may be required because of anti-spam regulations. You may need a "virtual number" to send from, which you enter as the SMS_param3 value in the EA. For further information, please see:

https://nexmo.zendesk.com/entries/22362928-Specific-Carrier-Restrictions-to-the-US-and-Canada-DIRECT-routes

3.2.2Setting up a Clickatell account

The procedure for setting up an account with Clickatell is a little complicated. The following steps could potentially change if Clickatell alter their website.

  • Create a "Clickatell Central" account at:
    https://www.clickatell.com/central/user/client/step1_new.php?prod_id=2.
  • Wait for the confirmation email to arrive, and then log in to your account at http://www.clickatell.com/login.php. Choose "Clickatell Central (API)" from the list of products.
  • Set up a connection by clicking on "Manage my products" and then choose "HTTP" from the "Add connection" list in the top-left of the page.
  • Give the connection any name you like, leave the other fields blank, and click on Submit.
  • The "Manage my products" page will refresh to show an "API code" for the connection (usually 7 digits).

You fill in your choice of username and password as the SMS_param1 and SMS_param2 values in the EA's configuration, and you fill in the "API code" as the SMS_param3 value.

3.2.3SMS parameters

The meaning of the SMS settings such as SMS_param1 depends on which carrier you are using:

Parameter

Nexmo account

Clickatell account

SMS_Carrier

Choose either Nexmo or Clickatell, depending on which you have registered with

SMS_param1

Nexmo "API key"

The username you chose when registering with Clickatell

SMS_param2

Nexmo "API secret"

The password you chose when registering with Clickatell

SMS_param3

If sending to a US or Canadian number, this needs to be a "virtual number" which you register through Nexmo. For other recipients, this is the text which you want to appear as the sender of the SMS.

The "API code" assigned after creating the HTTP "connection" within your Clickatell account