Building Your Expert Advisor
The 3 Metrics to Watch When You Build Your First Expert Advisor
When you start to design and build your first Expert Advisor – an EA that you plan on trading – it’s important to keep a close eye on these three metrics:
- Total Trades: The Expert Advisor should trade often enough so that you can quickly evaluate its performance.
- Entry and Exit Quality: Evaluate the quality of your Trade Entries and Exits.
- Winning Percentage: The Expert Advisor should win more than it loses.
OK, I realize a bunch of you are shaking your heads and saying “uh, yeah – no kidding, of course it should win more than it loses!”
But remember, there are plenty of good, profitable trading systems that lose more often than they win. Generally, this kind of system will take a small loss if the trade does not move in the positive direction. But if the trade does move positive, this system will allow the trade to run and take a large profit.
So, you end up with a profitable system that closes more losing trades than winning trades.
This kind of system is not ideal for your first Expert Advisor.
Here is an excerpt from my book Automatic Alpha explaining why.
|
How to Increase Your Winning Percentage
Almost all Expert Advisors can be split into two logical parts.
-
- The Trade Entry
- The Trade Exit
The responsibility of your Entry is to get the trade started in the right direction. That’s all.
The responsibility of your Exit is to get out of a bad trade quickly – or close your profitable trade.
The exit makes all of the money.
Known fact: If you get the chance to talk with a successful trader, don’t ask her how she opens a trade, ask her how she closes a trade. Again, your exit is responsible for making your profit.
Many traders, especially when they first start out, worry too much about their trade Entry and not enough about their trade Exit.
Use the Entry Test
If the logic of your EA can be split into its entry and exit, then you can test the Entry separate – without affecting the Exit. This is a huge advantage.
The Entry Test is simple. You remove your Exit logic completely, and just exit the trade after a certain period of time, for example 2 hours, or 1 day. When you look at the results of this test, you ignore the total profit. You only look at the number of winning trades.
The Entry Test shows you if your entry is getting your trade started in the right direction. Best of all, you can make changes to your entry logic and use this test to see if the change increased your number of winning trades.
Your Exit
Remember, there are a lot of ways you can exit a trade that are not based solely on a Takeprofit or Stoploss value. The exit could be based on an indicator, the time of day, etc.
Exits can be very creative. And they are usually worth the creativity.
I can’t say the same for entries. They can be very creative, but there seems to be a point of diminishing returns as you add more sophisticated criteria to the entry logic. (The Entry Test can prove this pretty quickly.)
Use the Exit Test
A great way to test the quality of your exit is to look at each closed trade, double how long the trade was open, and locate the highest profit point within the time range. This would have been the best time to exit the trade.
For example, suppose you bought the EURUSD on Monday and closed the position early Wednesday – so the trade was open for about 2 days. At the end of the week you would look at the EURUSD chart from Monday to early Friday (about 4 days) and note the highest trading point of the pair (highest because it was a long position, we’d use lowest for a short position).
Obviously, the point in time when the trade was at its highest profit value, within the 4 day period, would have been the best time to close the position.
This is only a rule-of-thumb test – you can vary the holding period – but this test gives you a quick look at how much profit you might have left on the table. And more importantly, when you are reviewing the chart, you may see something that gives you an idea to improve your exit.
One last point: I’ve found that a trailing stop often leads to a higher winning percentage and a lower overall profit. This does not sound like a good thing, but since you are trying to experience a high winning percentage with your first Expert Advisor, it might be something to consider.
I hope this information helps you in your quest to build your perfect Expert Advisor. Let me know!