Thursday, August 16, 2012

Expert Advisor Development

Building forex trading systems is the reason that this company exists. Nearly every one of our clients aspires to be a fully automated trader.

The percentage of clients that succeed over the long run, however, is incredibly small. I don't think that is a big secret. If that is news to you, allow me to be clear. The chances of developing a successful expert advisor over the long term are minimal.

The inevitable next question from new clients is an attempt to pick my brain for some features common to successful systems traders. I decided to outline the traits common to this rare breed and some of the challenges that they encounter.


 

Traits of a successful EA developer

Expert advisor developers that succeed are either incredibly bright (engineers, Ph.D. holders, etc) or dumber than a sack of rocks. No middle ground exists. A friend/client told me about an experiment that struck me as telling. If you put a mouse in a cage where cheese appears 40% of the time on one side of the box and 60% of the time on the other, all mice eventually pick the side that "wins" 60% of the time. The mice stop guessing and go with what works more often than not.

That's my theory for why the "intellectually challenged" crowd seems disproportionately likely to profit from trading. They see right through the noise to pick out a simple observation that wins more than it loses. Holy grail systems certainly do not come from this group. That's not honestly not the goal. It's about eating cheese more often than going hungry.

The brainy crowd benefits from a heavy dependence on analysis. Ideas usually stem from pet theories, many of which look like the crackpot variety on first glance. The theory shifts and twists as market tests reveal strengths and weaknesses. Logical conclusions instill a robustness and variety into the system. Interestingly, the approach to testing and verifying the systems follows the opposite path of most developers. The ideas tend to get simpler with time rather than more complex.

Emotion does not play a large role in the rationale for developing an expert advisor. Again, the reasons are usually logical. Examples like "I've been trading this system for 20 years and I need to automate it" or "I came up with a way to accurately predict market direction."

It may sound a bit zen, but the systems that make money are the ones that do not set their primary goals as making money. Making money is a totally open ended goal. The potential variables know no limit. The lack of constraint encourages would be EA traders to shoot off on tangents. Unless the wild ride accidentally leads to the pot of gold at the end of the rainbow, they will fail. The limitless bounds make it impossible to measure any progress.

In that same vein, the journey is as important as the destination. Many traders pay lip service to limiting drawdown. Few are able to effectively rein in drawdown, especially within the context of an expert advisor. To a certain extent, limiting drawdown is not possible. My experience with money management makes it clear how much wandering a return can make, even with a heavy advantage.
The easiest way to limit drawdowns is to fight against severe losses. The goal is to obsess over risk and reduce it to the lowest possible point. I want to emphasize this point carefully. Risk always exists. The market chaotically switches from deep slumber to extreme violence. No amount of system engineering eliminates or alters the structure of the market. The most effective way to handle risk that I see is not to prevent it from happening (not possible), but rather how to react when risk eventually flares up.

Approaching system design as a process rather than a destination also encourages global thinking. My old boss would describe it as the 40,000 foot perspective. When a forex trader, for example, emphasizes a system's percent accuracy, it typically comes at the expense of exiting at a better point in the market. A need to win slightly more often actually drags the system away from its optimal performance. A process oriented design watches how changes in the entry method affects the exit efficiency. Clever money management removes the emphasis from entry and exit methods.
Designing these systems takes hundreds of man hours or results from more than a decade of experience. Emotion will certainly enter the equation at some point. The real question is not how to remove it. It is how to appropriately channel it.

Designing an expert advisor quickly takes on the characteristic of an obsessive hobby. If the system's success is measured in quantities of dollars, the emotional roller coaster rises in tune with the account balance. A more appropriate use for the emotion is to take heart in the system working correctly, not profitably. Ideally, correctly also means profitably. They are not the same thing, however. Drawdown and unlucky losing streaks are an inherent part of trading. Gaining satisfaction from the trade behaving as designed rather than as desired makes your emotional well being far less dependent on market performance.

I have been running this company for nearly five years and literally spoken with thousands of traders over that time. In spite of that overwhelming number, I still have yet to speak with anyone that traded a commercial EA successfully for more than a few months.

The successful traders that I know personally all developed their systems and strategies on their own. Maybe that reflects on the abysmal quality of expert advisors for sale on the internet. Maybe it reflects on not-so-expert trading coaches, or perhaps genuine trading coaches and hapless traders unable to follow sound advice. I suspect it's a little of everything. Regardless of the problems, the take away point is that the person doing the succeeding is also the person doing the developing. They take control of the experience from the beginning and lead it into a successful outcome. Systems trading is not a process where you buy your way to success or follow like a sheep to green pasture. You must earn it.

Challenges of using a winning expert advisor

The path to achieving a profitable strategy on paper is a long, hard road. The switch from theoretical turns to live trading is a challenge in its own right. Backtests spit out instantaneous results. Traders see something like a 20% annual return, then mentally prepare themselves for the steady accumulation of funds.

That kind of trajectory puts a number in the trader's mind that is terribly misleading in real life. Steady annual growth of 20% suggests a constant return of 1.67% (20/12). That number 1.67% is a hiccup in a trading account. Many forex traders risk more than that amount on a single transaction. Factoring in the inevitable drawdown or periods of loss, the market makes it impossible to distinguish whether or not the expert advisor is behaving correctly or if it is falling apart.

Uncertainty in the face of risk makes any normal person panic. At the very least, it instills a degree of anxiety over the future. The moment that the machine stops churning out profits is the moment where doubt enters the picture. Doubt feeds on itself, which leads to changing the trading plan in midstream.
I can tell you from experience that the transition from research to execution is huge. A learning curve exists, like with everything. I learn to cope by taking the confidence that I gain through the same debugging techniques used in testing. The same techniques work for comparing live results to backtested results. Does the backtest over the same time period as my real trading match the actual performance? If so, then all is well. If not, it at least gives me as the developer an opportunity to think about specific problems. Execution or forex broker manipulation can cause problems. More often that not, however, is some flaw in the strategy design or code. Developing a methodical, reason based process helps calm nerves and to stay focused. The alternative is a general, undefined worry.