Cutting Through The Noise To Find The Most Profitable Trading Strategies. Forget the Hype - Read It Here First

Tuesday, August 30, 2011

Getting Started with MetaTrader

Before I get into doing more Expert Advisor Reviews lets get some of the basics out of the way first.

The first step is to go get MetaTrader and download the package. There are two versions of MetaTrader available, MT4 and the newer MT5. The majority of commercial systems developed in the market are for MT4 but either version will suffice.

The MetaTrader application is free to download and install. During the installation process you will have the choice to select your broker. It would appear all of the supported brokers offer demo accounts (not verified!), so it's quick to get started. Alternatively, you can go direct to a supporting broker and download the software. 

At this point you should have a demo account, access to a few currency pairs and the application itself. There will likely be a software update to do before you can stuck in which is just a matter of updating and restarting.

Adding a chart is easy. You can do so from the menu items (this will offer the main currency pairs), you can right-click a price quote in the Market Watch list and add a new Chart Window, or a chart can be added directly from the File menu.

You can change the viewable timeframe, add annotations, price overlays and technical indicators, or enter a trade from a chart.

The timeframe can be adjusted from the toolbar, a right click on the chart or from the Charts dropdown menu.

To add annotations, click on one of the toolbar options; then mark a point on the chart and either drag or complete the text box. Annotations can also be added from the Insert menu

There are a number of ways you can indicators to the chart, including custom indicators. The core set of indicators are available from the toolbar, Insert menu or from the Navigator.

Custom and core indicators are available in the Navigator menu. When adding an indicator from Navigator menu it's necessary to left-click on the indicator and drag it on to the chart before releasing the click. Any custom indicators you purchase or create will be listed in a seperate folder to your primary (or default) indicator set.

You can enter trades (in this case, demo trades) either from the Market Watch window. Right click on the instrument you want to trade and select New Order (short cut F9)

or right click on the chart and select Trading - New Order.

So what about trading strategies?

Trading Strategies in MetaTrader are called Expert Advisors. These are listed in the Navigator window. Your MetaTrader program offers two sample trading strategies: MACD Sample and Moving Average.

There are a few things you can do with a strategy. You can add it to a chart (i.e. market) and trade it or you can edit it in the supporting MetaEditor application.When you Attach to a Chart the strategy will be added to the currently viewed chart.

Only one strategy can be added to a chart/market. If you wish to trade your strategy across different currencies you need to add the strategy to each chart. Likewise, if you wish to trade a strategy across different timeframes, you need to add a strategy to each timeframe chart.

When a strategy is added to a chart it will appear with a smiley face icon in the top-right of the chart. If there is an 'x' instead of a face it's because the Expert Advisors button in the menubar is switched off (red).

When the face is 'unhappy' the strategy is switched off and no trades are generated. Clicking on the face to make it 'happy' activates the strategy for that market.  If you are trading a live account with real money then trades will be generated using real cash.

Focus should be limited to one chart and one strategy. Trading across multiple markets or timeframes is taxing and it's easy to overlook where signals are generated.

Initially, you will be dealing with a demo account, but once you are ready to go Live you will need to ensure the Live Trading Button is checked in the Strategy setup menu. This menu appears when a strategy is added to a chart. This menu is also available by right clicking on the chart attached to the strategy and selecting Properties.

It may also be prudent to check the Ask Manual Confirmation button to see how the strategy works in practice. Any strategy can be traded Long & Short, Long or Short.

When trading commercial strategies it's frequently necessary to click the Allow DLL Imports check box.

The real-fun with MetaTrader comes with tinkering your strategy (which will be a seperate articled). Part of this process is Back Testing a strategy. To do this we need to open the Strategy Tester, available from the View Menu and Toolbar.

This opens the Tester menu located beneath the chart.

In order to back test a strategy, first select your Expert Advisor from the dropdown menu (at the start there are just two to choose from). Start with MACD Sample. Then select Expert Properties next to it.

Expert Properties allow a top-level control of the strategy. Optimization allows another level of protection to a strategy.

For Inputs, individual values (like the Lot size) can be changed by clicking on the Value and editing it.

For the purpose of this Back Test we will leave all of these variables unchanged.

Next it's necessary to set the Symbol and Period. Both of these choices are dropdown menus.

The Model adopts Every tick and may (or may not) involve Optimization. The Modify Expert opens MetaEditor and allows you to tinker under the hood of the stategy.

The Use date defines the lookback period of the Back Test.

In order to maximise the number of ticks the Back Test should avail of the most amount of data available. To access data go to Tools - History Center

Select a Market on the left, including the timeframe, then click Add. This will upload the data to the window on the right, then click Download to bring the data into your MetaTrader application. You may need to do this for each timeframe you are interested in trading.

You may not need to this for EURUSD, but for other Markets - like indices - it may be necessary to import this data. 

Next, go into Options of the Tools menu. Then go to Charts and change the Max bars in history and Max bars in chart to 9999999999999.

Once you have the data you can then run your Back Test.

The next step is to hit [Start]

This will run the strategy with your settings as selected in Expert Properties.

An Alert will sound once the strategy is complete. The various tabs show the differerent outputs of the Back Test.

The Results shows each signal, including the initial entry (buy/sell), the modification when the stop loss changes (modify), the exit by stop (s/l) or target price (t/p).

The Graph shows the Cash:Equity Return for the Strategy

The Report summarises the strategy returns, including number of trades, returns from Long positions and returns from Short positions.

The full report can also be downloaded and viewed in a browser. To do this, right click in the Report/Results/Graph screen and click Save as a Report.

With this, you now have the basics to start playing around with MetaTrader...

You can download MetaTrader Here