Wednesday, April 8, 2009

Automated Trading Championship – Why Join?

What are the possible reasons for wanting to participate in ATC? The reasons are many, from the most trivial of just having some fun to potentially finding business opportunities. Let’s discuss some of this.


1. Self-selected MQL4 Olympian


Well, when you are a participant, you country is listed and so are your fellow countrymen. Within that you can have fun to see if you are doing better than them or better still in a small world like us, it looks like an Olympic game. Just think - you cab select yourself to represent your country.


2. Self-disciplined EA


Your EA needs to be efficient in using computing resources and error-free. Even if you have escaped the scrutiny before the competition, you may run into some errors which will disqualify you. Participating will help you build more efficient EAs and force you to discipline your EA and yourself and up the ante.


3. Making new MQL4 friends


Hey you can go around as a participant and drop messages on other participants and they on yours, so hopefully you get to know more like-minded MQL4 freaks.


4. Benchmark your EA


This is a good time with all participants on common ground to pit your EA against others and see how well it performs. It will tell you how good or bad your strategies are. Or maybe it is not the strategies but poor coding. Whatever it is, it will help you to see what kind of EA you have written.


5. Selling your EA.


If your EA show promising results, rest assured that there are many eyes from all over the world who will express interests to purchase your EA.


6. Business opportunities


Or you might get requests by intermediaries who will host your EA as a list of offerings to their customers and earn some bucks in return.


I am sure there are more. If you can think of any, drop me some comments!

Thursday, March 26, 2009

Automated Trading Championship – Rules that are hard to understand

It is important to understand all the rules of MetaQuotes’s annual Automated Trading Championship. Last year’s rules are found here.

One of the most difficult rule to understand is under Trading Terms #4.

“The minimum trade size is 0.1 lot, the maximum one is 5 lots with the step of 0.1 lot for each order.”

Here is a breakdown of what it means:

1. There is only one decimal place for lot size ie 0.2, 1.3, 2.4, etc. You cannot place lots with 2 decimal places ie 0.12, 1.32, etc

2. The smallest lot size allowable is 0.1.

3. The largest lot size is 5.0.

4. “step of 0.1 for each order” means you can place a lot with 1 decimal place as in point 1. It does not mean that after you place a lot size of 0.1, the next lot size allowable is 0.2. No, it just means use one decimal place.

I think this is the most difficult rule to understand, the rest seems pretty straightforward. However, there are two more that may disqualify you from participation. Under Participants, rule #5 and #6

#5. The Participant can be registered only once within the Championship. Registration of your friends or relatives instead of you will result in your disqualification. If any registered persons display their ignorance of trading, they will be disqualified.

#6. The attempts of multiple registrations or use of anonymous proxies will result in unambiguous disqualification of the Participant.

These two rules are to prevent multiple entries by a single person, who uses other people’s names for registration. I think the organisers detect this by checking for submission of EA entries from the same computer. There are always dispute over this but to avoid any misunderstandings, it is best to submit from your own computer and let no one else use your computer to submit theirs. After all, if your friend is in automated trading, he or she should have their own computer and connections to be fiddling with EAs! Apart from detecting where the submission source is, I do not know how else this can be checked.

Thursday, March 19, 2009

Automated Trading Championships – Rules for Efficiency

The Automated Trading Championships (ATC) organised by MetaQuotes is attracting more and more participants each year. Some rules of the competition may seem peculiar at first glance but they are there for good reasons.

Servers efficiency is important to handle the increasing number of EA submissions. As CPU resources are precious and limited, Expert Advisors (EA) need to be efficient in the utilisation of these resources including disk space. For a start, errors are not tolerated because they will increase the server load and errors will repeatedly waste important CPU resources and disk space. Many of these errors are often overlooked because we are not affected by them in trading, live or demo – at least we thought.

Once the competition starts, you have no control over your EA and if it does not behave, your EA will be disqualified. One example is the issuing of orders when your account does not have enough money. In real life, we would have just unplug the EA and not let it deplete our account. In the competition, you have no control and you need to handle such situations in your coding. Let’s run through some of the errors.

1. Not enough money

Use AccountFreeMaginCheck with the lot size you intend to check against your Free Margin before sending out your orders. If there is not enough money, reduce the lot size. Of course, if your account has blown and the smallest lot volume is not even possible to issue, then keep looping your EA until the competition is over.

2. Handling Requotes

Do a RefreshRates and check if your order succeed and repeat this until your order is sent successfully. RefreshRates gets you new price quotes to work on.

3. EA takes too long to run

After you have submitted your EA, the organiser will run your EA from the start of the current year to the date of testing. And your EA should take less than 10 seconds to complete. If not, your codes are not efficient. One CPU resource sucker is the multiple ifs statement. So instead of using

if (A>B && B<C && C==D)

change it to

if(A>B) if(B<C) if(C==D)

I am sure there are many other errors and taking the effort to remove these errors will improve your EA efficiency. Perhaps these little steps will get your EA to do the right thing at the right time when used in real trading.

Thursday, March 12, 2009

Automated Trading Championship

The Automated Trading Champion (ATC) is a contest by the maker of metatrader to encourage the use of automated trading through their platform. Started in 2006, the interest in this championship has grown tremendously. In 2006, there were only 258 qualified participants. In 2008, it has grown to 705. The results is even more impressive. Give a starting equity of $10K, the winner in 2006 grew his account to $35K. Then in 2007, the winner had a balance of $130K. But in 2008, the winner won the competition at $169K. The table below summarises what has happened over the past three years.

What is even more interesting is that the number of participants who could grow their accounts to more than the equity given is a vey small percentage. Less than 20%of the participants were able to grow their accounts; the majority were not able to win a cent. There are many reasons, I am sure. It is only a competition using demo accounts and no real money is used. The participation is free and so there is no pain on the side of the participants except developing a trading strategy and coding the ideas into an EA. This environment will drive the behaviour of the trading strategies used by the participants. As the championship grows in numbers and increasing balance obtained, the EAs will only get more aggressive and risky. Most participants will risk all their capital to forge ahead, something that most will not do in real life and with real money.

Perhaps it is time to change the competition's requirement so that more realistic EAs will be written. After all, many people are interested to use the EAs in real accounts and want to buy them from the owners. Nothing wrong with this. The sad aspect is that most of the winners turned losers after the competition. And we are taken for another ride...

  2006 2007 2008
Total Registered Participants 753 2011 2420
Total Qualified Participants 258 603 705
Total above USD10K 44 91 128
Highest Balance (USD) 35,175.56 130,475.45 169,584.64

Thursday, February 26, 2009

Using Expert Advisors To Evaluate Your Trading Psychology

In my first blog entry on this series of articles on the uses of expert advisors, I mentioned how EAs can be used to research trading strategies. I would like expand this topic and discuss about trading psychology.

Scenario A: Seething Courage to Carry On
One thing for sure: if you trade with real money versus demo accounts, your whole trading psychology will change. What you dare to do in a demo account, you may not dare to execute live. For example, you have a strategy to average in your orders. You take a buy order but the price moved against you. You take another buy order, hoping to average your price entry. Meanwhile the strategy advocates no stop losses for you entries. When you run it off the Strategy Tester, the results show a profitable strategy. But when you eventually run it live, you may not stomach the drawdowns, and wondered how many levels you need to go before the prices come back. You pull the plug - aha - human intervention of a EA - is that good or bad? Let's not answer this question for now. But the point is this - if you execute orders against a trend, and your orders have no stop losses, how would you behave in live trading against a backtest or even demo account?

Scenario B Seeing the EA through.
Suppose a backtest of a trading strategy over a year period, say 2008, showed a not so profitable period but eventually it ended with a nice profit It is comforting to start off with your EA making profits but what do you when your EA makes a string of losses? Do you carry on or do you stop the EA? The graph shows an EA performing well for a period and then becomes non profitable (period 262) and finally coming through at end with a nice profit. Great graph to look at. But how do you behave during the one year period rather than a few seconds or minutes of simulation?

Scenario C: Seeing is Believing
Or you were told that Metatrader's Strategy Tester is useless and inaccurate. Suppose your EA showed such a negative performance in the Tester, would you go ahead and trade it live? If the Strategy Tester is lying when you get good graphs, how much lies are you getting from a downward spiralling profit graph?

Scenario D: The Seeing Leads the Blind
Neural networks are getting popular these days for forex trading. One thing about NN systems is that you need to do some optimisation because it is a pattern recognition system and hence as new patterns comes over a new period, the software needs to be trained. During demo, you watched the EA fire orders, and you have no idea how it figured out when to send an order and when not to. During live, the same thing happened. When it makes money for you are fine! When it loses, what do you do? What have you learnt about trading from such a strategy? Nothing! Is that what you want? If so, then neural network-based EA are for you.

I hope you have a flavour to look out for what your heart tells you.

Thursday, February 12, 2009

Using Expert Advisors for Non-Trading Purposes

Expert Advisors have been traditionally set up for some form of trading, but they are computer programmes after all. That means, they can do almost anything you want. I shall cover one interesting use.


You don't have the luxury of time to sit in front of a computer the whole day. You have gotten hold of some interesting indicators which you would like to try out. How can you study these indicators which get refreshed and repainted as the price ticks come into your charts.


MQL4, the computer language for programming EAs in the metatrader platform has a function called WindowScreenShot that allows you to capture a snapshot of your computer screen and store it as a picture file. If you capture a series of these pictures over a period of time, you would be able to have an idea of what has happened with your indicators. Better still run it off some software (eg InfranView) that allows you to string the pictures into a video.


Where can I find such an EA? Go get it from this article, "A Non-Trading EA Test Indicators".


As you can see, using an EA is not always about trading. It is about helping you do your trading better. Have fun!

Thursday, February 5, 2009

Using Expert Advisors Interactively with Your Chart for Trading

How would you like to look at a chart, draw a trendline, and enter a trade when a certain condition is met and have the EA issue the order and managed it? Well TrendMeLeaveMe by waddahattar is one of the most innovative uses of an EA that I have come across.


As simple as that, by drawing a trendline and naming the trendline "buystop" or "sellstop", the EA will monitor the prices and when it hits the trendline, a stop order will be issued with the specified TP and SL This is certainly a neat tool to put into your list of arsenal.


Or try a variation of this by dreamer3 called MTrendLine. After you have placed a pending order, draw a trendline and name it after the ticket no of the pending order you have just placed. The pending order get modified according to the trendline direction. Very similar to TrendMeLeaveMe but you get to issue the pending order first for MTrendLine whereas TrendMeLeaveMe will isssue the pending order for you. Both will modify the pending order price level according to the trendline drawn.


Hope you are intrigued by this method of doing your trades especially when you are the type the uses this kind of strategy.


One important point though. Look through the codes of these EAs, test them out, and demo them. You might find some faults with their implementations and you may need to correct them before going live with them.