Feb 17, 2012

dan-rsi-2b EA

This robot from 15-04-2010 is another one relying on the values of 2 RSI indicators to place orders. RSI(5) attempts to tells if the market is over-brought or over-sold, while RSI(20) determines trend strength.

The robot opens a BUY market order if the larger RSI is above 50 but below 70, the smaller RSI is below 80, and a 3 period EMA seems to be going up.

The results are not good:



(Back-test on 60 minute chart, EURUSD, 1-1-2011 to 1-1-2012. Stop-loss 23, take-profit 54, trailing-stop 42).

You'll notice it placed no long trades. This is because there was a bug in the way it calculated the RSI values.

I remember this robot performing reasonably well on demo tests (but as with all my robots, only for a while). I must have fixed the bug in the version I was demo trading, and this version is one of the original backups.

Let's fix the code (available here), tweak the settings a little, and see what happens:




(Back-test on 60 min EURUSD chart, 1-1-2011 to 1-1-2012, stop-loss 30, take-profit 500, trailing-stop 30).

The win rate has almost doubled from 25% to 47%, and it makes a profit of almost 10% over the year, $995.

Not too happy with the equity curve though. Notice it stops making profit about half way through? This happens on too many robot back-tests.

As it turned out, there was more than 1 bug in the code. There's a section called "ASKdiff" which in place of any other sort of trade trigger, makes sure the ASK isn't too far away from a 3 period EMA. It looks like I coded it quite badly and it also wouldn't allow a BUY condition.

Almost all of my early robots used this code. I don't think all of them failed to place BUY trades, so I must have modified it at some stage. Yikes, I better go check!