Saturday, December 25, 2010

Meta-Trader - FX-Regression

Welcome back Meta-Traders.

Here's wishing you a happy winter solstice and warm greetings of the season.

Not much happened in my live or demo accounts this past week, so instead i'm going to talk about my own EA called FX-Regression.

Since starting my automated trading with Meta-Trader about a year ago, i've coded quite a few expert advisors. But all of them have ended up on the scrap heap and none have been worth of risking any real funds. Now, I finally feel like i'm onto something and i'm ready to share my findings.

The logic of the system is incredibly simple and goes something like this:

- Wait until a particular hour of the day which is at the end of regular active market hours. Trading days are Monday through Thursday, no trading Sunday or Friday.

- Place a sell limit a certain number of pips above the market a buy limit a certain number of pips below the market. The number of pips in each direction is fixed and is the same amount in either direction.

- Once one of the orders is filled, cancel the opposite one.

- If neither order is triggered within an 8-hour period, cancel both orders and start again the next day

- Take profit is when the price returns to its original value when the orders were placed.

- Stop loss pips is just under 3X the take profit value meaning the system can loose 1 out of 4 times and still be profitable.

This screen shot shows some of the typical action. In the first case, the 8 hours expires and the orders go unfilled. In the second case, the trade triggers in the first 2 hours then stays open for 15 hours before hitting the take profit. In the third case, orders are placed, one is filled and the take profit occurs within the hour.

One thing I like about this system is that it benefits from sloppy, ranging, directionless market action which is what the market does most of the time. How can I say the market does this most of the time? Based on back-testing:

- When trading EUR/USD - the system is profitable 76.8% of the time

- When trading USD/CHF - the system is profitable 77.2% of the time

- When trading USD/CAD - the system is profitable 84.95% of the time!

What about performance?

Over a 10-year backtest, on EUR/USD the system averaged over 14% per year with 2 loosing years and an average drawdown of about 14%. Risk per trade was roughly 5% of the account. The system performed even better on USD/CAD and USD/CHF, see backtest results below. A few other points:

- The system does have long periods of drawdown and is by no means a holy grail. But it does provide a statistical edge that can be exploited.

- The system takes losses when the pair gets into a strong trend and therefore is a good compliment to trend-following systems.

- Performance can be improved by avoiding trading when a strong trend is in place. I implemented one such trick in the presets file for EUR/USD to get the performance shown above.

- Tests were performed using Alpari data and fixed spreads based on recommended values from Asirikuy.

I suspect that the system will perform best when trading all 3 of the above pairs in a single account in a portfolio fashion. Before I can assess the performance of the system as a portfolio, I need to learn how to to and use the Profit and Drawdown Analysis tool by Gabor as found on Asirikuy. That will allow me to more fully understand the drawdown behavior of the portfolio and determine adequate risk levels before I start trading it live.

I have uploaded the FX-Regression EA and presets files for the 3 pairs above to my Yahoo group at http://finance.groups.yahoo.com/group/fx-mon/.


2 comments:

  1. Good job Chris!

    I am very happy you have a potential EA that you created. The data looks promising. It is always nice to use other peoples EA's as they did the work for you, but nothing beats the experience and knowledge you gained from creating your own EA.

    Good luck my friend

    JT

    ReplyDelete
  2. JT-

    Thanks for the comment JT, I appreciate it!

    Chris

    ReplyDelete