วันเสาร์ที่ 16 พฤษภาคม พ.ศ. 2552

Automatize the trading process using Expert Advisors.

If you want to automate completely the process of making deals and managing orders, as well as to avoid psychological element while taking a decision but control the current market situation the best way is to avoid routine work is to use Expert Advisors.

Expert Advisors in MetaTrader are special programs, developed in the specialized language MetaQuotes Language 4 (MQL 4) that give possibility to automate analytical and trading operations. Expert Advisors allow to make an analysis of the current market situation automatically and on the base of the signals received they can send commands to execute trading operations and to control open positions.

The technology of testing Expert Advisors on historical data gives possibility to get results as much as possible close to those received from testing Expert Advisors online on a demo-account. To check Expert Advisors’ effectiveness for the period of several years will take no more than a few minutes, i.e. you don’t have to wait for years to confirm profitability of your trading strategy!

MetaQuotes Language 4 language is very simple to learn. However, to create Expert Advisors you don’t have to be a professional programmer, we won’t cover the subject of writing your own Expert Advisor in this book.

Quick access to the program functions by means of the «Navigator» window.

«Navigator» window «Navigator» window

The «Navigator» window makes it possible to get access to different program functions.

All the functions are represented as a tree and are divided into 5 groups:

  • 1. «Accounts» — the list of accounts. By double-clicking an account you skip to another one.
  • 2. «Indicators» — the list of the available technical indicators. To add the specified indicator to the active chart just double-click it. Besides, using the Drag’n’Drop technology you can add an indicator to any chart. In order to do this click the left mouse button on the selected indicator and holding it shift the indicator to the chart.
  • 3. «Expert Advisors» — the list of the available advisors. Expert Advisor — is a MetaQuotes Language 4 program which realizes any trading strategy. Expert Advisor has the access to the terminal's data and can make trading transactions automatically.
  • 4. «User Indicators» — the list of all available user indicators, i.e. the MetaQuotes Language 4 programs realizing the function of an indicator.
  • 5. «Scripts» — the library of user functions designed for storing frequently used blocks of user programs.

To show the group's contents press plus, to hide the group's contents press minus.

Trailing stop.

Trailing Stop — is an algorithm of a Stop Loss order level managing.

If you place a Trailing Stop (for X pips) the following will happen:

  • MetaTrader doesn't do anything until the profit of an open position reaches X pips. Then MetaTrader places a Stop Loss order at the distance of X pips from the current price (at the breakeven point in this case).
  • Once the first step is completed MetaTrader sends a command to modify the level of the Stop Loss order by the distance of X pips from the current quote every time when the distance between the quote and the previous order's level exceeds X pips. As a result the Stop Loss order «catches up» the current price.

In order to place Trailing Stop highlight the necessary open position in the «Trade» tab in the «Terminal» window and press the right mouse button. In the appeared context menu you can set Trailing Stop level.

Trailing Stop placing Trailing Stop placing

In order to place the pending order in the «New Order» window change the type to the «Pending order».

Trailing Stop — is one of the most effective instruments of maximizing profit. If you determine the value of Trailing Stop correctly you won't close out earlier than the price movement in your direction finishes. Trailing Stop can significantly increase profitability of your trading practice.

You should start MetaTrader and connect it to the Internet to make Traling Stop work.

Place/Modify/Cancel Pending Orders.

Pending order is a client’s instruction to open a position if the price reaches the order’s level.

There are four types of pending orders:

  • 1. Buy Limit — to open a buy position, if the Ask price reaches or falls below the order’s level. The current price level at the moment of the order placing is higher than the Buy Limit order level;
  • 2. Buy Stop — to open a buy position, if the Ask price exceeds or reaches the order’s level. The current price level at the moment of the order placing is lower than the Buy Stop order level;
  • 3. Sell Limit — to open a sell position, if the Bid price exceeds or reaches the order’s level. The current price level at the moment of the order placing is lower than the Sell Limit order level;
  • 4. Sell Stop — to open a sell position if the Bid price falls lower or reaches the order’s level. The current price level at the moment of the order placing is higher than the Sell Stop order level.
Pending orders Buy Stop, Buy Limit, Sell Stop, Sell Limit Pending orders Buy Stop, Buy Limit, Sell Stop, Sell Limit

In order to place a pending order enable the «New order» window using one of the methods, described in the «Open/close position» section and change the type for «Pending order».

Pending order placing Pending order placing

In this window you can modify the following fields:

  • «Symbol» - the currency pair for which you want to place a pending order;
  • «Volume» - the deal’s volume in lots (the size of 1 lot in Alpari is shown in «Contract Specification»);
  • «Stop Loss» - the level of a Stop Loss order that will trigger once the pending order triggered;
  • «Take profit» - the level of a Take Profit order that will trigger once the pending order triggered;
  • «Commentary» - you commentary on the pending order;
  • «Type» - the type of the pending order: Buy Stop, Buy Limit, Sell Stop, Sell Limit.
  • «At the price» - the pending order level;
  • «Expiration» - if you don’t put the mark the order is valid until it is canceled or triggers. If you put the mark the pending order is valid until the time specified in the field.

In order to finish the process of a pending order placing press the «Place order» button and it will be displayed in the «Terminal» window in the «Trade» tab.

In order to modify or delete a pending order highlight it in the «Terminal» window and press the right mouse button and in the appeared context menu select «Modify or delete order» item. In the appeared window you can modify the order level by pressing the «Modify» button, or you can delete the order by pressing the «Delete» button.

Modify/delete a pending order Modify/delete a pending order

Place/modify/cancel Stop Loss and Take Profit orders.

Take Profit – is an order to close a position if the market price reaches the Take Profit order level.

This order is placed at the price, which is better for the trader than the price at the moment of placing the order. In case the price reaches this level the position will be closed at the price of Take Profit order.

Stop Loss – is an order to close a position if the market price reaches the Stop Loss order level. This order is placed at the price which is worse for the trader than the price at the moment of placing the order. In case the market price reaches this level the position will be closed at the price of the Stop Loss order.

Placing Take Profit and Stop Loss orders allows a trader to leave his place at the computer not waiting for an outcome (favorable or unfavorable). Take Profit and Stop Loss orders will be executed automatically when the price reaches the order level. So once you placed them you can easily turn off your computer and wait until one of the orders trigger.

You can place Stop Loss and Take Profit orders just at the moment of making a deal. To do this you should fill in the «Stop Loss» and «Take Profit» fields in the «New order» window.

In order to modify the levels of Stop Loss and Take Profit orders enable the context menu by pressing the right mouse button on an open position or on a pending order in the «Trade» tab in the «Terminal» window and choose the «Modify or cancel order» command. The «Modify order» window will appear.

Modification of Stop Loss and Take Profit orders level Modification of Stop Loss and Take Profit orders level

The minimum distance between the placed order and the current market price is limited. As a rule you cannot place an order nearer than at a distance equal to the size of spread from the current market price.

In order to modify Stop Loss and Take Profit orders level fill in the « Stop Loss » and « Take Profit » fields. By pressing the red button («1.2228» in our case) you can copy this reading into the «Stop loss» field. By pressing the blue button («1.2234» in our case) you will copy the reading into the «Take profit» field. Figures in the «Level» window determine the distance between the nearest permitted order and the price that will be displayed on the «Copy» button.

Once you filled in the «Stop loss» and «Take profit» fields press «Modify the position # number …». In case of a successful order’s level modifying the report window will appear.

Modified Stop Loss and Take Profit orders levels report Modified Stop Loss and Take Profit orders levels report

In order to cancel a Stop Loss or Take Profit order set its value equal to zero.

Stop Loss and Take Profit orders will be executed in the following cases:

  • Take Profit for a buy position, when the Bid price reaches or exceeds the order’s level;
  • Stop Loss for a buy position, when the Bid price reaches or falls below the order’s level;
  • Take Profit for a sell position, when the Ask price equals or falls below the order’s level;
  • Stop Loss for a sell position, when the Ask price equals or exceeds the order’s level.

An order will be executed if in the flow of quotes there will be at least one quote that reached the order’s level.

You should remember that in the clients terminal MetaTrader 4.xx charts are created using Bid prices, that’s why:

  • the minimum Ask price will equal the minimum bar’s price (Low) plus spread;
  • the maximum Ask price will equal the maximum bar’s price (High) plus spread;
  • the minimum Bid price will equal the minimum bar’s price (Low);
  • the maximum Bid price will equal the maximum bar’s price (High).

Open/close a position.

If the analysis made by you has shown that the currency pair chart will grow you should buy. We always buy at Ask price. To buy a currency pair means to buy the currency which is the first in the abbreviation, and sell the currency which is the second. In this case making a deal you bet on that the currency you buy will strengthen and the currency you sell will weaken. I.e. for a unit of the first currency you will get more units of the second one or that is to say that currency pair's rate will rise.

If your analysis has shown that the given currency pair chart will fall you should sell. We always sell at Bid price. To sell a currency pair means to sell the currency, which is the first in the abbreviation, and to buy the currency, which is the second. In this case making a deal you bet on that for a unit of the first currency less units of the second one will be given, or in other words the rate of the currency pair will fall.

In order to open a new position you have to activate the «New order» window. There are several ways to do it:

  • 1. click the right mouse button in the «Market watch» window or in the «Terminal» window (the «Trade» tab) and choose the «New order» item in the context menu;
  • 2. press the F9 hotkey;
  • 3. use the «Service -> New order» menu;
  • 4. click the right mouse button on the chart and select in the appeared context menu the «Trade -> New order» item;
  • 5. double click a currency pair in the «Market watch» window.
      • «Symbol» — the currency pair you want to make a deal on;
      • «Volume» — the deal's volume in lots (sizes of 1 lot in Alpari are shown in «Contract Specification»);
      • «Stop loss» — a Stop Loss order level;
      • «Take profit» — a Take Profit order level;
      • «Commentary» — your commentary on the deal.
    • As a result of any of the abovementioned actions you will see the «New order» window.

      «New order» window (Instant Execution technology) «New order» window (Instant Execution technology)

      There are two technologies of making deals: «Instant Execution» and «Execution at request».

      Instant Execution means that for making a deal there's no need to request quotes from the dealing center as you can see them in real time in the «New order» window. If at some moment the quotes offered by the dealing center will suit you you can open a position by pressing the «Buy» or «Sell» button.

      Quotes for the currency pairs that are traded using the Instant Execution technology in the «Market watch» window are the quotes that the dealing center offers for making a deal.

      Quotes for the currency pairs traded using «Execution at request» in the «Market watch» window are indicative and you can not make a deal without a prior request. In this case when you activate the «New order» window the buttons «Buy» and «Sell» are inactive but the additional button «Request» appears.

      «New order» window («Execution at request» window) «New order» window («Execution at request» window)

      Once you pressed the «Request» button the dealing center will offer you quotes for making a deal.

      Quotes request for making a deal Quotes request for making a deal

      The quote offered by the dealing center will be valid within few seconds. By pressing the «Buy» or «Sell» button you will open a new position for buying or selling respectively. This position will appear in the «Terminal» window (the «Trade» tab).

      Position opening confirmation Position opening confirmation

      It is obvious that the «Instant Execution» technology is more convenient for a trader than the «Execution at request» technology. It takes just a few seconds to make a deal on a real account while in case of using the «Execution at request» technology the time needed for making a deal increases up to 30-40 seconds (on a demo account all the operations are done within several seconds, as demo accounts are quoted automatically while real accounts are quoted by people).

      Additionally in case of the «Execution at request» quotes in the «Market watch» window are indicative, that is the quote offered by the broker can differ from the the quote in the «Market watch» window, you saw before making a request.

      Consequently the possibility of making deals using the «Instant Execution» technology is an important factor while choosing a dealing center. In Alpari every instrument has been traded with the «Instant Execution» technology from 2005.

      Before making a deal you can modify a number of fields in the «New order» window:

      In order to close a position you should select it in the «Terminal» window (the «Trade» tab) and press the right mouse button. The context menu appears where you should choose the «Close order» item.

      Context menu of the «Trade» tab in the «Terminal» window» Context menu of the «Trade» tab in the «Terminal» window»

      If you double click the left mouse button the open position in the «Terminal» window will give the same result. The «New order» window will appear, where the «Close the position # number …» button will appear.

      Position closing («Instant Execution» technology) Position closing («Instant Execution» technology)

      In case of the «Execution at request» technology you should at first request quotes for making a deal from the dealing center by pressing the «Request» button. After that the «Close the position # number …» button will become active.

      Position closing («Execution at request» technology) Position closing («Execution at request» technology)

      If the market is quiet deals are made at the quotes offered by the dealing center. However when key economic news is released the market dynamics can become so fast-moving that the the quotes offered by the dealing center will quickly go out of date (in less than a few seconds given to a trader for making a decision on the deal). In this case the old quote will be cancelled and the «Requote» window will appear, where the broker will offer new quotes.

Types of charts and ways of their creating in MetaTrader.

Trading terminal allows to see on the screen as many charts as you want at the same time for different currency pairs and for different periods of time. Charts are created in real time.

In MetaTrader you can create the following types of charts:

  • 1. Line chart. In such type of charts axis of abscissas is for unit segment of time (minutes, hours, days, months etc.), and axis of ordinates is arithmetical. To create a chart of this type closing prices are used, i.e. the prices of the last quotations in each period (each minute, hour etc.). The resulting points are connected with straight lines. It is recommended to use such charts for short periods of time (up to several minutes). In order to change the chart type for the line one you can press the line button on the «Charts» bar, use the Alt+3 key combination or the «Charts -> Line» menu.
    Model of a line chart creating in MetaTrader. Model of a line chart creating in MetaTrader.
  • 2. Bar chart — a chart, consisted of bars, each of them showing the maximum price “high” (upper point of the bar), minimal price “low” (lower point of the bar), opening price “open” (a little line left of the vertical bar) and closing price “close” (a little line right of the vertical bar) for a given period of time (for instance, for 1 hour). It is recommended to use such charts for the periods of time from 5 minutes and more. To change the charts type for a bar one you can use the bar button on the «Charts» bar, use the Alt+1 key combination or the «Charts -> Bars» menu.
    Model of a bar chart creating in MetaTrader Model of a bar chart creating in MetaTrader
  • 3. Candlesticks — are created similar to bar charts. Forecasting with the help of candlestick chart was one of the most popular methods of technical analysis in 80-90-s. This method is one of the most demonstrative and natural. Most often candlesticks are created for daily charts. This is because of the fact that it is this period of time for which this method was developed and used. The psychological background of this method of technical analysis is based on the correlation of the opening and closing prices of one and the same trading day, as well as closing prices of the previous trading day and opening prices of the next trading day. A candlestick differs from a bar by shape. Between opening and closing prices a square is drawn, which is called the candlestick body. The vertical little lines above and below the body are called shadows and show the maximum and minimal prices in this period of time, respectively. The candlestick body is colored differently depending on the relative positions of opening and closing prices. In the world practice the following method is used – if a bar closed on a higher level against the opening price the white color is used, if a bar closed below the opening level the candlestick body is colored in black. In order to change the chart type for candlestick one you can use the candlestick button on the «Charts» bar, use the Alt+2 key combination or the «Charts -> Candlesticks» menu.
    Model of candlestick chart creating in MetaTrader Model of candlestick chart creating in MetaTrader

In order to create a new chart for a certain currency pair click the right mouse button on the «Market watch» window and select in the appeared context menu the «Chart window» item.

New chart creating New chart creating

Using the Drag'n'Drop technology you can replace one chart to another in any open window. To do this you should seize the necessary currency pair with the help of the mouse from the «Market watch» window and holding down the left mouse button «drop» it in the chart field.

Chart periodicity — is a period of time information for which is shown in a bar or a candlestick. For instance if we create a 15-minute (M15) bar chart each bar will contain the information about price dynamics within the corresponding 15 minutes.

Informational trading terminal MetaTrader gives possibility to create charts with the following time intervals: 1, 5, 15, 30 minutes (M1, M5, M15, M30 respectively), 1 hour (H1), 4 hours (H4), 1 day (D1), 1 week (W1) and 1 month (MN). In order to change the chart’s time period you can use the «Chart periodicity» toolbar.

The «Chart period» toolbar The «Chart period» toolbar

Quick access to the chart’s settings you can get with the help of the context menu, activated by right mouse button clicking at any place on the chart.

Chart context menu Chart context menu
Chart Chart
  • «Periodicity» — activates the submenu for selecting the chart’s time period; This operation can be done also by pressing the period button on the «Charts» toolbar;
  • The «Charts» toolbar The «Charts» toolbar
  • «Refresh» — in case of mistakes or «gaps» on the price chart missing records from the server are downloaded and reflected in the chart;
  • «Grid» — hide/show the grid in the chart;
  • «Volumes» — show/hide tick volume (the number of quotes for the given period of time);
  • «Zoom in» / «Zoom out» — enlarge or minimize the chart’s scale. Another way is to press the инк / дек buttons on the «Charts» toolbar or to click the «+» or «-» keys;
  • «Save as picture…» — save the chart in the form of graphic file in gif or bmp format;
  • «Properties…» (hot key F8) — enables the chart settings window and with the help of the «Colors» tab you can set the color for different chart’s elements.
The «Colors» tab of the chart’s properties window The «Colors» tab of the chart’s properties window
The «General» tab of the chart’s properties window The «General» tab of the chart’s properties window

Most settings in the «General» tab speak for themselves.

We will describe only several items that can be difficult to understand.

  • «Autonomous chart» — this option stops receiving and reflecting quotations for the given chart. Once the chart is open offline (the «File -> Open autonomously») the option activates automatically;
  • «Chart shift» — allows/prohibits to shift the chart from the right edge of the window. Another way is to press the Chart button of the «Charts» toolbar or with the help of the«Charts -> Chart shift» menu;
  • «Auto scroll» — enable/disable the function to scroll the chart automatically to the left once the new tick come. Another way is to press the autoscroll button of the «Charts» toolbar or to use the «Charts -> Auto scroll» menu.

Forex Technical Analysis ©Template Blogger Green by Dicas Blogger.

TOPO