Thursday, October 13, 2011

Multiple Time Frames or Pairs in an Expert Advisor

Many strategies incorporate multi-timeframe analysis in their decision making process. Consider the example of a moving average cross strategy. The most basic version says to buy when a fast moving average crosses above a slow moving average. Multi-timeframe analysis involves jumping to a chart of a longer period to consider the setup there, as well.

Example:
The 20 period SMA (fast) crosses above the 50 period SMA (slow) on the M15 chart.
Now jump to the H1 chart. Is the fast SMA greater than the slow SMA on that chart, too? If so, then the trade is allowed. If not, the EA skips the signal and waits for another one.

The technique has the potential to work if your strategy offers some type of statistical advantage. Moving averages sometimes work when applied using a trader's discretion of general market volatility. If you leave an MA cross strategy on a chart unattended, however, my expectation is that you would have no better chance than trading at random. Adding another layer of analysis will not change the fact that the basic premise offers no advantage.

MetaTrader does not restrict Expert Advisors to reading information from the applied chart. When you program an EA to trade on EURGBP M5 chart, you may also read price information from the EURGBP M1, EURGBP H1 or any other chart available. You can even read information on multiple pairs.

Some traders like to watch correlated currency pairs. EUR/USD and USD/CHF typically share a -90% correlation. When EURUSD goes up, USDCHF typically goes down. Exceptions do occur, and those traders tend to look for exceptions on the expectation of them ironing themselves out. Expert Advisors make this fairly simple to handle. You just program the question, "What's the last closed price of EUR/USD M5 and USD/CHF M5?" The code gives you the answer, then the EA can make decisions with it.