Wednesday, September 15, 2010

EAs... a not quite short review

Ok... my previous post was a little too short but that I was feeling to say at the moment.  Reviewing my own experience with expert advisors, I could tell that a year and a half ago, I was surfing the web when suddenly I found a web page with some amazing something automated something... something.  I thought: ok... let's see... ok...  keep reading... ok...

So, as always I wasn't convinced about what they were claiming but I just was curious about that new topic to learn.  At that time, I was just used to the propietary platform from my broker and didn't have any idea about anything else.  I read about these amazing forex robots and automated strategies that work in a super platform called metatrader4 or mt4;  I thought, ok let's try to get that amazing platform and study if it has more technical tools or so.   I downloaded it and played with it to get used to it; it was really different of my other program but it has several other indicators and tools to play with.  Something useful that I found was fib extensions and projections, which I don't have in my broker's plattform yet.

Back to de EAs...  because of the incredible results of these "robots", a few thoughts ran through my mind at the time...  basically, if they do work, how is it possible that nobody is billionaire?, if those algorithms are bulletproof, why are poverty in the world? If is that easy, why an economic crisis is hitting the world that moment in time... and so on... and so on... 

Seriously, if a EA works so well, and it produces tons of money... why should they sell it?  even if it is incredible profitable, how much do you think that it should cost? why they are selling it for a few bucks? a few houndred bucks?  They might be earning money not for the work of the "robot" but for selling the EA instead. 

Well, with all these questions around my head, I said, let's try to write one by myself... I don't have a strong coding and programing skill, I just know the basics.  At that time, I wrote some code based on the examples that metatrader has, changing variables, using some indicators, trying to use conditionals like if... then...
Because I'm a mechanical engineer, or more appropiate term could be manufacturing engineer,  I have some math basis and have struggle with some programing in the past.  Not in c++ but vb and even my texasinstrument89 calculator.

With a few algorithms written by my own, I did some back testing in the platform.  And have some mixed results.  I tweak a little and a lot my strategies when I suddenly have incredible results in my automated backtesting analysis.  I remember have seen to the ceililng and said... "finally, I didn't thought that it was that easy".  My backtesting resulted in several trades without any loss during a defined period of time.

Then I started to analyze more in depth... and I didn't like what I saw.  That algorithm had a flaw, actually a lot of them.   Metatrader allows to plot in a chart every trade triggered by the EA when backtesting, and I started to analyze every single of them when it hit me...  That just didn't work at all.   First of all, I was more concern in entries and exits when coding, not in protection stops or money management.  I saw those triggered trades in the backtested chart and watched some of the trades worked out, but almost every trade ran against the position, and not just enough,  way to much.  That shocked me bad...

It's not difficult to have an amazing backtesting result in MT;  just try this...  just remove from the algorithm the protective stop in every order and run the backtesting.  That could result in two different scenarios:  a complete success and a complete failure.  I had the first one and I got excited when it happened, but later the cold reality hit me. 

With that in mind, I started to test this algorithm again, and again, and again... different timeframes, different pairs... etc.  And as expected, in some times it performed really well, and in others just blown the account. I tweak the algorithm for a conservative stoploss and what a different result.  I could say that almost every time that I've tested it, the result was a drawdown in the account, a margin call, maybe a breakeven.   I tested other strategies but neither seemed to work.  And basically that was it.  I expend a lot of time learning something that I shouldn't.  Obviously I don't regret that experience though, because I learnt other things along the way about technical analysis.

.