The optimization trap

Making more tests with the optimization process of my last EA i can conclude that for 2010 the EMA cross most profitable is 8 with 173 for short positions.

I found that with bigger values in Take Profits and Trial Stops the expert can get more profits like for example:

2717.52             578.42                          StopLoss=550      TakeProfit=6050      Tral_Stop=1750
profit                   drawdown $                  stop loss                take profit                    start trailing at

This means that my EA using the cross of the 8 EMA and the 173 EMA taking only short position made from 2010-01-01 to 2010-08-30 ( 8 months ) 2717.52 dollars with an initial deposit of 500 dollars. The 2717 is pure profit, the initial 500 are also there, so the trader using this system from the beginning of the year haves now a total of 3217 USD.

This last results are not the closer to the truth i can get, those results were just one of the best passes of the optimizer using control points. I am loading now this variables to the strategy tester and the results are even a little better:


The details

The proof of fire will be to test this in year 2009, i know that the classic 21 and 200 cross failed at 2009.

This is the optimization trap, the values picked was for that period of time and simply don’t work in others when conditions are different.
2010 was a big downtrend almost all the year:

The problem with a simple crossing moving averages expert is that it is to simple, it don’t check how are the conditions of the overall market, i will probably try to use more than one time frame to make something better. For example if trend is down in a h4 or daily chart use only short strategies in the 15 min charts and vise verse.

I am not ready yet.

Tags: , , , ,

Robot Optimization

Optimization of expert advisors will help me find the right parameters for different variables of the program in a period of time. It is better to use the 20 ema crossing the 200 ema or the 30 ema crossing the 193? all this kind of questions can be replied with the optimization process.

I will use control points instead of every tick so the process will be faster, we will use Expert Advisor 9 for optimization. I will run the optimizator with data of the current year, starting january 1 and ending july 31.

The 2 moving averages for the cross will be optimized, the take profits variable, the stop loss variable and the trailing stop will all be optimized as well. the mql build in optimizer will combine all this and display a report.

There is no need to use the same values for short and long trades, what it works good for long it don’t necessarily haves to work for short trades so i made 2 optimizations runs and here are the results:

Long Optimization Reports

Short Optimization Reports

It looks that the optimizer found great results for short trades, the draw down is of 20% and the expected payoff is high. This is what we look in an expert advisor, big payoffs and small drawdowns.

With this new optimized values:

StopLoss=250     TakeProfit=1850     Period_MA_1=9     Period_MA_2=171     Tral_Stop=750

i make a new expert advisor optimized for short sales, when i run it in the strategy tester using the most precise data now we get this curve from january 1st 2010 to today:

Details

Tags: , , , , , , ,

Expert optimization words

ok, so i have for instance an expert advisor that use the cross of emas as trade signals . we were using common ema values for this like 21 with 200 cross.

how do we know this are the best values for a given period like for example for the first 7 months of the current 2010 year ? How do we know what is the best pip amplitude to start trailing the stop on a given period ? To answer this question is for what we use optimization build in feature of metrader. it will test all possibilities for all the variables i want.
let’s say we want variable Period_MA_1 to goes from 1 to 200, and Period_MA_2 can go from 1 to 500, of course the normal variables we used (Period_MA_1=21 and Period_MA_2=200) will be also included at a given point of the optimization.

What are the best values for stop loss ? and for take profits ? All this question will be answered when the optimization process ends, it is a very long process but extremely powerfull as the computer will make thousands of tests for me.

We don’t know if what happened in the past will bee seen again in the future but if i can make an expert that is making money consistently in the last 4 or 5 years, with small drawdonwns, using the 90% feed data we will be closer to put a robot to trade live in the near future.

Tags: , , ,

More historical tests

demonstrates that the EA 9 ( http://fforex.me/robots/emas-cross-21-200-trailing-stop-corrected-tests/ ) had a really bad year during 2009 ending the year with losses.

a loss for an entire year means that the expert will not be profitable, further actions should be taken, i am now working on optimization of this expert. see next post.

Tags: , , , , ,

Message to our You-Tube subscribers

Tags: , , , , , ,

Danny on Aug roll in Sept

Tags: ,

MACD Expert advisor tests

The MQL community page ( http://www.mql4.com/ ) is a great source of information and it provides me articles and source code. I can use the expert advisors made by other programmers and test them up, make modifications to them, use parts of their code, etc.

To start with this lets try a classic expert advisor that use the macd histogram and a signal line, this strategy was not something i use to trade on the days of manual trading but what i like from this expert is the way it is coded, a lot less code than what i was using to make expert advisors from the mql book.

Here is the article page: http://articles.mql4.com/84

The short and long entries are defined with the following:

The expert don’t have a stop loss, exit is executed when:

  • Long exit – by execution of the take profit limit, by execution of the trailing stop or when MACD crosses its Signal Line (MACD is above zero, goes downwards and is crossed by the Signal Line going upwards).
  • Short exit – by execution of the take profit limit, by execution of the trailing stop or when MACD crosses its Signal Line (MACD is below zero, goes upwards and is crossed by the Signal Line going downwards).

I have the historical test of 2010 for euro against dollar, 15 min chart in here: http://fforex.me/robots/macd/

As expected the expert didn’t had a great year but the lack of stop loss also have some very big losses, for example in january 2010 i can see a loss of -197.38 in a single trade. this goes totally against my tolerance, it is a very big loss for my trading style.

So i tried a new version that can also insert a stop loss of 30 into the trade, with this we will not have those big losses but we are also limiting the expert, remember that less risk can also mean less profit sometimes, this is what is happening in this case:

MACD expert with stop loss of 30

I like how it is coded as it is more compact than the expert sample of the book , i am not really expecting a profit from it, also i have to test all the experts i can found for free, it will help me understand more about the mql programming language.

Tags: , , , , ,

Danny in the Dumps

Tags: , ,

EWT Taiwan Index Fund

GDP up 12.5%,Taiwan Oylimpic Game 2019,Free Trade agreement with China

Tags: ,

Risk Reversal Trade

Tags: , , ,