MQL4 - automated forex trading   /  

Forum

Automation sample for the MetaTrader 4 Client Terminal

Back to topics list  | 1 2 To post a new topic, please log in or register

avatar
3001
Ais 2008.08.11 22:22 
A System
article

A Non-Trading EA Testing Indicators

All indicators can be divided into two groups: static indicators, the displaying of which, once shown, always remains the same in history and does not change with new incoming quotes, and dynamic indicators that display their status for the current moment only and are fully redrawn when a new price comes. The efficiency of a static indicator is directly visible on the chart. But how can we check whether a dynamic indicator works ok? This is the question the article is devoted to.


avatar
3001
Ais 2008.08.11 22:24 
Instructions
1. Safety and security
   1.1. Inspect the security level of the terminal.
   1.2. Be sure to empty all the options in "Expert Advisors" tab, except "Enable Expert Advisors".


avatar
3001
Ais 2008.08.11 22:24 
2. Preparation
   2.1. Shut down the terminal.
   2.2. Copy   the "A.EX4"     file to the "..\EXPERTS"            folder.
   2.3. Copy   the "AS_4.EX4"  file to the "..\EXPERTS\INDICATORS" folder.
   2.4. Copy   the "S.TXT"     file to the "..\TEMPLATES"          folder.
   2.5. Review the aforequoted files contents.
   2.6. Rename the "AS_4.EX4"  file as "AS.EX4".
   2.7. Rename the "S.TXT"     file as "S.TPL".

avatar
3001
Ais 2008.08.11 22:24 
3. Test run
   3.1. Start    the terminal.
   3.2. Complete authorization    in the "File\Login"         menu.
   3.3. Select   any trade symbol in the "File\New Chart"     menu.
   3.4. Select   any period       in the "Charts\Periodicity" menu.
   3.5. Select   the "S" template in the "Charts\Template"    menu.
   3.6. Clocks at the top of the screen will appear.

avatar
3001
Ais 2008.08.11 22:25 
4. Installing the profile
   4.1. Shut down the terminal.
   4.2. Create the folder "..\PROFILES\A".
   4.3. Copy   to the "..\PROFILES\A" folder following files:
        4.3.1. "CHART01.TXT",
        4.3.2. "CHART02.TXT",
        4.3.3. "CHART03.TXT",
        4.3.4. "CHART04.TXT",
        4.3.5. "CHART05.TXT",
        4.3.6. "CHART06.TXT",
        4.3.7. "CHART07.TXT",
        4.3.8. "ORDER.TXT".
   4.4. Review the aforequoted   files contents.
   4.5. Rename the "CHART0*.TXT" files as "CHART0*.CHR".
   4.6. Rename the "ORDER.TXT"   file  as "ORDER.WND".

CHART01.TXT
CHART02.TXT
CHART03.TXT
CHART04.TXT
CHART05.TXT
CHART06.TXT
CHART07.TXT
ORDER.TXT


avatar
3001
Ais 2008.08.11 22:25 
5. Launching the automation
   5.1. Start    the terminal.
   5.2. Complete authorization   in the "File\Login"    menu.
   5.3. Select   the "A" profile in the "File\Profiles" menu.
   5.4. You will find:
        5.4.1. the 6 trade symbol frames;
        5.4.2. the main module frame at the "EURUSD,Monthly" chart.
 

avatar
3001
Ais 2008.08.11 22:25 
6. Accessing the automation controls
   6.1. Press the "F3"  key.
   6.2. The "Global Variables" window will appear.
   6.3. Make sure english language input is activated.
   6.4. Push  the "Add" button.
   6.5. Input "A1" and press the "Enter" key.
   6.6. Press the "Esc" key.
   6.7. Press the "F3"  key.
   6.8. New global variable list will appear.
   6.9. Adjust the "Global Variables" window size.
 

avatar
3001
Ais 2008.08.11 22:25 
7. Automation controls review
   7.1. The 5 leading items are service purpose.
   7.2. The next combined in 4 groups of 7 items, the first items are headers.
   7.3. Items "Limits"   control limits.
   7.4. Items "Show"     control plotting.
   7.5. Items "Strategy" control trade  strategies.
   7.6. Items "System"   control system settings.
   7.7. Avoid changing the system settings.
 

avatar
3001
Ais 2008.08.11 22:25 
8. Caution
   8.1. Automation system settings change   can cause blocking the terminal by broker.
   8.2. Trade attempt at weekend or holiday can cause blocking the terminal by broker.
 

avatar
3001
Ais 2008.08.11 22:25 
9. Automatic trade
   9.1. The sample supports up to 6 symbols      automatic trade.
   9.2. Delete the "A0" global variable to start automatic trade.
   9.3. Create the "A0" global variable to stop  automatic trade.
   9.4. Set    the "A0" global variable value "2", attempt to close all open orders will result.
 

avatar
3001
Ais 2008.08.11 22:26 
10. Creating the position list
    10.1. Shut down the terminal.
    10.2. Create text file contents:
          10.2.1. header <"...">, where "..." is any text;
          10.2.2. strings " n/ position/ symbol/ comment/", where:
                  10.2.2.1. "n/"        is position number,
                  10.2.2.2. "position/" is position name,
                  10.2.2.3. "symbol/"   is trade symbol name,
                  10.2.2.4. "comment/"  is any text;
          10.2.3. end of list </"...">, where "..." is any text.
    10.3. Save  the file as "A#######.APL", where "#######" is account number, in the "..\EXPERTS\FILES" folder.
    10.4. Start the terminal.
    10.5. Complete authorization for account number "#######" in the "File\Login" menu.
    10.6. When the automation will start, attempt  to read the "A#######.APL" file will be made.
    10.7. In case of success the automation will work with the "A#######.APL" position list.
    10.8. In other case attempt to create internal position list will be made.
 
Example 1. File "A1234567.APL" contents

<Position List For Account 1234567>
 1/      HKD/     USDHKD/     Currency   7/ US Dollar vs Hong Kong Dollar
 2/      NZD/     NZDUSD/     Currency  11/ New Zealand Dollar vs US Dollar
 3/      RUR/     USDRUR/     Currency  12/ US Dollar vs Russian Rouble
 4/     GOLD/       GOLD/     Commodity  1/ Gold (Spot)
 5/      #AA/        #AA/     CFD        1/ Alcoa Inc
 6/     #XOM/       #XOM/     CFD       32/ Exxon Mobil Corporation
</Position List For Account 1234567>
 
Notes

1. The same trade symbols may have different names.
2. Trade symbol that contains one position  hereafter called "single". 
3. Trade symbol that contains two positions hereafter called "complex" or "cross".
4. The position list feature supports "single" trade symbols.
5. Global variable "AxSYMBOL" excludes trade symbol "SYMBOL" from automatic trade.
 
Back to topics list   | 1 2  

To add comments, please log in or register