MQL4 - automated forex trading   /  

Articles

Articles  Features  Secrets of MetaTrader 4 Client Terminal: Alerting System To post a new article, please log in or register


This article is about
MetaTrader 4
Download MT 4 - 5.5 Mb

Mobile trading!
Buy a license and be mobile in your trading!

Secrets of MetaTrader 4 Client Terminal: Alerting System [ ru | cn ]


    System Events


Open the "Tools -> Options" menu and go to the "Events" tab. By default, a WAV file is used to alert about one of eleven events.



These files can be found in the \MetaTrader 4\sounds\ directory of the Client Terminal. The alert can be modified as desired. To do so, open the popup list in the "Action" column by double-clicking with the left mouse button on the selected line.



The alert can be both a WAV file and an executable file ("EXE", "VBS", "BAT").



If a file of another type is chosen for alerting, the application related to this file type will be launched. After having selected an action, press Enter to confirm the choice. The event alert can be disabled by double-clicking with the left mouse button on the line in the "Event" column.


    User-Defined Events


Custom events can be of two types:

  • the price reaches the pre-defined value for the desired symbol;
  • the pre-defined timeout is reached.

 

To set up alert, you have to go to the "Alerts" tab in the "Terminal" window and press Insert.



The alerts can be enabled/disabled by pressing Space, and modified by pressing Enter.


Alerts can be of three types: a sound alert, an executable file, an emailed message. For all alert types, it is necessary to specify the "Symbol" and conditions (fields "Condition" and "Value"), at meeting of which the alert will trigger. In the fields named "Timeout" and "Maximum iterations", it should be specified how many times and with what regularity the alert will trigger.



    Sound Alerts


Both files stored in the \MetaTrader 4\sounds\ directory of the Client Terminal and any other files can be used as sound alerts: "WAV", "MP3", "WMI". If a file in the "MP3" or "WMI" format is chosen, the application related to these file types will be launched at alert triggering.




    Executable Files


Executable files can be in formats of "EXE", "VBS", "BAT". If a file of any other format has been chosen, the application related to these file types will be launched at alert triggering.




   Emailed Messages


To get alert messages via email, it is necessary to make presettins in the "Email" tab of the "Tools -> Options" menu. Check the "Enable" field and enter your email server settings in the corresponding fields. In each field, you can see red prompts about the data format to be entered.

  • SMTP server – address of your mailing server when accessed via SMTP. Please do not forget to specify the port number separated by a colon. It is usually port 25. Example: smtp.mail.ru:25
  • SMTP login – it is usually your email address. Example: your_name@mail.ru
  • SMTP password – a password used to access to your mailbox.
  • From: – you should enter the login ("Your name") and your email address on the same server, the SMTP of which you would like to use. As a rule, the login coincides with the first part of the email address, but it can be skipped. Example: your_name, your_name@mail.ru
  • To: – email address you would like to send alerts to. The "Your name" part of the address can be skipped. In general, the "To:" field should be filled out with any real email address. Example: any_name, your_name@mail.ru


Click on the "Test" button and check whether the message has been delivered to the email address you have specified in the "To:" field. If all settings have been written correctly, the message: "Mail: 'Test message' has been sent" must appear in the "Journal".


For sms messages to be sent, you have to specify the email address provided by your cellular operator in the "To:" field. To use the operator's SMTP server as such, you have to verify its settings on the operator's website or at the accounts department. At that, please keep in mind that not all cellular operators permit to use their SMTP servers without calling to POP3 servers.


Then the alert as such can be created. To do so, press Insert in the "Alerts" tab in the "Terminal" window. Fill out all the fields:




To create the message text, click on the  button near the "Source" line. Enter the subject and the body of the message. Both in the subject and in the message body, you can use "Macros". The list of macros is available from the context menu.


After this, click on the "Send" button.

Having filled out other fields, click on the "Test" button and check whether the alert has income at your mailbox. If the message has been sent successfully,  the corresponding record will appear in the "Journal":




    Publishing of Reports on FTP Server


The terminal allows publishing in internet reports about the account status on a periodic predetermined base.



For this, it is necessary to set up connection to the internet via FTP. Open the "Tools -> Options" menu and go to the "Publisher" tab.

The red color specifies the format to be used for entering the data.



The data transfer can be performed in either active or passive mode. The main deifference between them is the side that opens connection to transfer data. In the active mode, the FTP server initiates connection, and in the passive one, the customer does.


Periodicity is the minimal time intervalб with which the report will be published. At that, if a trading position or order changes in the terminal, the report will be forcedly and immediately published. This mechanism provides data accuracy (except for the current market price and the profit) in the report.

After all settings have been made, click on the "Test" button. If the report has been successfully sent, the corresponding line will appear in the "Journal".



    

Translated from Russian by MetaQuotes Software Corp.
Original article: http://articles.mql4.com/ru/159
Created: 2006.09.13  Author: Tatyana Vorontsova
Warning: All rights to these materials are reserved by MetaQuotes Software Corp. Copying or reprinting of these materials in whole or in part is prohibited.
Secrets of MetaTrader 4 Client Terminal
Secrets of MetaTrader 4 Client Terminal

21 way to ease the life: Latent features in MetaTrader 4 Client Terminal. Full screen; hot keys; Fast Navigation bar; minimizing windows; favorites; traffic reduction; disabling of news; symbol sets; Market Watch; templates for testing and independent charts; profiles; crosshair; electronic ruler; barwise chart paging; account history in the chart; types of pending orders; modifying of StopLoss and TakeProfit; undo deletion; chart print.

Secrets of the MetaTrader 4 Client Terminal: Indicators
Secrets of the MetaTrader 4 Client Terminal: Indicators

Are you going to write your own indicator? Perhaps you will find that what you need among indicators already embedded in the client terminal. So why to reinvent the wheel? A summary table of integrated indicators' characteristics; special features and methods of attaching indicators to a chart; building of levels; displaying of indicators on different timeframes.

13 comments: 1 2   To add comments, please, log in or register

how to make metatrader to alert for following events:

1- a position closed by TP

2- a position closed by SL

3- a position closed manualy

4- a candle closes ( a tick alert to be played)

5- a position becomes closer to SL (as SL box color turns red)

6- a position becomes closer to TP (as TP box color turns green)

any help much appritiated

VICTOR1967

2009.03.12 22:58 victor1967
How do I disable the alert window from poping up?
2008.12.15 03:06 BIGFOOT
Can you make alerts for indicators?/ I mean when there is a crossing of MA200, or RSI etc.???
2007.12.03 01:29 Alexis1965
vixenme wrote:
njel wrote:
think, the standart smtp server working on 25, and terminal configured for working with this port only. Hope, the developers will teke in to account this little trouble.

even i use :25 this appear

08:14:27 Mail: 'Test MAIL' failed
08:14:45 Mail: 530 5.7.0 Must issue a STARTTLS command first m1sm191840uge
The matter is that not all postal services permit to use their SMTP servers without calling POP3 servers. For example,  google.com does not permit it. You can contact your postal service to get the detailed information.
2007.07.17 17:25 Tatyana
apache wrote:

I DON"T HAVE ANYTHING ABOUT YOUR ALERT,,WHY,


Please send us the email with detailed description of your SMTP settings at support@metaquotes.ru
2007.07.17 17:23 Tatyana
elmagd2000 wrote:
I do get a test message and appear in journal but at real expert signals I don't
get any email.

Pls. advise

You have to check the code of your expert advisor. Please refer to our community for the help.
2007.07.17 17:20 Tatyana
lalilo wrote:
hello,

Is there a way to let MetaTrader sent me SMS to my cellphone (through GSM modem or a cellphone that is connected to PC)?

mostly I need the alert when the connection is lost.

Yes, you can if your cellular operator permits to use their SMTP server without calling to POP3 server. You have to contact your cellular operator's support service for more details.
2007.07.17 17:19 Tatyana

I DON"T HAVE ANYTHING ABOUT YOUR ALERT,,WHY,

2007.06.13 14:49 apache
I do get a test message and appear in journal but at real expert signals I don't get any email.
Pls. advise
2007.05.02 23:08 elmagd2000
hello,

Is there a way to let MetaTrader sent me SMS to my cellphone (through GSM modem or a cellphone that is connected to PC)?

mostly I need the alert when the connection is lost.
2007.01.28 17:11 lalilo
13 comments: 1 2