Feb 9, 2012

dan17-trendfollow-sma EA

This robot is dated 3rd April, 2010. I was continuing my development efforts of a moving average cross robot, but due to my lack of knowledge of MQL4, it lacked the cross part.

I had modified FireDave's UniversalMACrossEA (which did include a proper moving average cross trigger), trying to create my own, cooler, fortune making EA.

From reading through the comments I included in the code, it looks like I had just found out about consolidation in the Forex market, and was trying to include ideas to compensate for it. The default stop-loss was set to 40, take-profit at 80, and trailing-stop at 60. Moving averages are set at 5 SMMA and 40 SMMA. I'm guessing that I was trying this robot on the 15m time frame.

It's a very simple robot, which checks back several bars of each moving average to ensure they're still going in the correct direction, and finds the difference between the moving averages, as well as the difference between the moving averages and the ASK price. It won't open any trades if the difference is too great.

If I had only known how to code in a decent cross at the time, I could have done away with these extra checks.

I was still trying to calculate the angle of the moving averages, but the code is still commented out.

How does it run?

I turned the money management option off, and told it to use 0.1 lots, deleted my MetaTrader 4 history data, and re-downloaded the EURUSD data. I back-tested it on the H4 time-frame from 1-1-2011 to 9-4-2012, and this is the result:


It's actually not the worst robot in the world. It lost approximately $1,300 in 13 months, from an initial balance of $10,000. It even made a slight profit as far along as March 11, 2011.

Keep in mind, despite reloading fresh history data, I suspect there's still something really strange going on. So these back-tests can be trusted only slightly more than a hungry crocodile with your pet poodle covered in BBQ sauce.