Forex Blog

First-hand Forex trading experience and information about foreign exchange market that will be useful to traders


RTATC2011 — Day 2 — Components of a Successful EA

June 12, 2011 by Andriy Moraru

So, let’s continue with our preparations for the upcoming ATC 2011. I’ve decided to start with the very beginning and outline the most important components of a successful MetaTrader EA. Please note that while some of the properties described below are good only for participation in ATC, others can be used as a guidance in your usual expert advisor development.

Main Idea. To create a good EA for ATC, you need to have the main idea for it. Whether it will be some existing MetaTrader expert advisor or something completely new, depends on you. Price action, moving averages, chart patterns, some exotic indicators, neural networks — they all can be a part of this main idea, the principle of your EA. I have yet to choose the main idea of my ATC EA and this will be the topic of my next post in RTATC2011 series.

General Optimization. After you have coded an EA around your main idea, it’s time to optimize it. But one should be careful with optimization. Overoptimization will lead only to losses during the championship. The best strategy is to optimize your input parameters, so that the EA works profitably on several different time periods. After that, it’s a good idea to find the optimal input parameters for each of the currency pair that will be traded by this EA (more on multi-currency trading below).

Z-Score Optimization. It’s a kind of an advanced optimization technique that can work with some of the EAs to dramatically improve the trading results. I will explain more about Z-Score in a dedicated RTATC2011 post, meanwhile you are welcome to read about it on Wikipedia. In short, positive Z-Score greater than 2 means that there’s a high probability that the winning trade will be followed by a losing one and vice versa, negative Z-Score less than -2 means that there’s a high probability that the winning trade will followed by another winning one and the losing trade will be followed by yet another losing trade. Obviously, this offers quite nice optimization schemes.

Multi-Symbol Trading. Although the winners of the ATC 2010 were all single-currency EAs, I still insist that the multi-symbol EAs have an advantage over the single-symbol ones during the ATC. That’s why it is very important to prepare your expert advisor to trade with all the 12 currency pairs that were permitted to ATC 2011. Unfortunately, you won’t be able to attach a single-currency EA to all 12 currency pairs charts. For that, you’ll probably find useful my explanation of how to create multi-symbol EA using classes and objects.

ATC Money Management. It’s obvious that only the EAs with an aggressive money management strategy can win in ATC. The EA should risk a lot to win a lot. Reverse Martingale strategy will work best here — you increase your position size when you win and you reduce it when you lose. Some traders set the maximum possible position size from the very beginning of the tournament. In my opinion, it is too risky. I prefer my EA to be able to lose about 5–10 positions in a row (depending on its win/loss ratio) with the starting volume before going completely bankrupt. Additionally, one should be aware that the maximum position size for a given currency pair is 15 lots, while the maximum size of one order is only 5 lots. So a special system of orders should be implemented to open huge positions when the account balance reaches a point, where such sizes are sustainable.

Fast Execution. Needless to say that if your EA is very good but it requires more than 20 seconds to place one order, it won’t be successful in ATC. More than that, the contest jury may decide that it’s a too heavy burden on the ATC demo servers and won’t approve such an EA for participation. That’s why too complex expert advisors isn’t the best choice for this championship. It’s better to try implementing something light and fast but still effective.

Dealing with Trading Conditions. As with all the previous ATC contests, in ATC 2011, the trading conditions will be modeled with all the realism of the actual MetaTrader brokers — you’ll get requotes, slippages, order delays and other unpleasant obstacles. The EA you develop, should comply with this conditions and behave properly. That’s not too difficult to implement and it will be discussed in my later posts.

Reboot-Safety. All sorts of bad things may happen to the trading servers during ATC — they may hang up, they may be rebooted, the platform may get updated to a new version. In all these cases your EA will be restarted, while your positions and pending orders will remain there, in the market. Your expert advisor shouldn’t “forget” about those positions and orders and should always remember its current state — what was opened and why. Generally, it can be accomplished in two ways: by using some log-file, that can be read with each EA restart to find out the current state of affairs; or by going through the MetaTrader position history (open and/or closed) to see the same data.

Back-Testing. 9 months of chart history (from 2011-01-01 through 2011-09-01) will be used by the ATC to back-test the EAs to find out if they fit the rules of the contest. The expert advisor should make at least 5 trades during that period, be profitable, produce no errors and do not imply a too heavy load on the trading server.

Forward-Testing. I believe that at least one week of forward-testing is required for a final version of an expert advisor submitted for ATC. It will help you to see how it works in the “real world”, analyze its money management behavior and watch it struggling with the market conditions for which it couldn’t be optimized yet.

If you are wondering what’s this all about, please read my first post in RTATC2011 series.

P.S.: There are currently 346 participants registered for ATC 2011. 3 months and 12 days left till the end of registration period.

If you have any questions or suggestions regarding the main components of a successful MetaTrader 5 expert advisor for the ATC 2011 contest, please reply using the form below.

Leave a Reply

required (will not be published)