Backtesting/Optimization - page 28

 

Imagine, everyday at the 00.00 the ea (during his normaljob) start a optimization (with genetic algorithms) for a x amount of data (1 month, 2months, 1 year, 1 day), and at the end of the optimization it check the results, and choose the values that gived the best results (high profit, low drawdown), and modify his value with the new ones, without stop his work!

It can be done manually, but if it can be done automatic it can be also better no?

 

My Experiences

Assuming, you have %90 tick quality, and not a beginner,

1. Tester is a big gun. It works if you know how to use. Otherwise you spend from your life for EA tests, at least 2-3 years you need to wait on live data.

2. Tester is not suitable for multi-timeframe and multi-currency system. If your system forcing complex points, ask producers.

3. There is no valuable expert on the net. So this is not tester's problem. But people says tester is bad. No, we are bad.

4. Waves of forex market are changing year by year. If a system works one year, the next year it may fail. So, an expert must be educated for many years.

5. The only relible trend is (monthly) even (5 yearly) trends in this market. But these trends are not suitable for high leverage. This is reducing our chance for high leveraged EA's.

Thanks

Cengiz

 

the little details in machine learning

w4rn1ng:
Imagine, everyday at the 00.00 the ea (during his normaljob) start a optimization (with genetic algorithms) for a x amount of data (1 month, 2months, 1 year, 1 day), and at the end of the optimization it check the results, and choose the values that gived the best results (high profit, low drawdown), and modify his value with the new ones, without stop his work! It can be done manually, but if it can be done automatic it can be also better no?

everything which can be described exactly, can also be programmed. Maybe mq4 is not the most suitable tool to do it, but it can be done.

A practical detail: depending on your EA/your indicators/your optimisation interval, automatic optimisations can eat a lot of time. I mean: to reoptimise the parameters for the next day, you need not 5 minutes but 5 days :-(.

Questions:

1.) did you test your idea by hand ? Was it a success ?

2.) Why 2 months of reoptimisation intervall ? Why not 1.5 or 2.5 ?

3.) what exactly means "best result" ? Do you prefer 1000$ profit after 500$ drawdown, or better 600$ profit with 100$ drawdown ? Do you prefer a system which made 2000 $ (first week to 2200, next 7 weeks down to 2000), OR do you prefer another system which made 100..200 $ each week (totally 1300$) ?

 

I think its best to optimize by hand and find best parameters for 2006 and then test them on 2007. If both show similar results, I check 2004-2007 period. If that goes well, I keep these parameters.

If you optimize every month, the EA won't be able to trade normally - I already checked that. The best optimization result was gained in a yearly optimization.

You can also optimize for market conditions. Trending periods should use one set of parameters, slow market/side market periods - another set. But who will tell what period is it now?

Reoptimizing daily gives crappy result.

Oh and about that data that made the EA work bad - don't worry. I had the same result when I uploaded EUR/USD data on GBP/USD data. The result was mixed quotes. If you delete the quotes and restart MT4 in offline mode and then upload only one set of quotes (correct ones), it should be working fine.

Also in order to check if modeling is fine, I have few sepparate copies of MTs, and I check EAs on different MTs from different brokers. Gives a bit different results but nothing special (helps identify problems)

 
autopips:
everything which can be described exactly, can also be programmed. Maybe mq4 is not the most suitable tool to do it, but it can be done.

A practical detail: depending on your EA/your indicators/your optimisation interval, automatic optimisations can eat a lot of time. I mean: to reoptimise the parameters for the next day, you need not 5 minutes but 5 days :-(.

Questions:

1.) did you test your idea by hand ? Was it a success ?

2.) Why 2 months of reoptimisation intervall ? Why not 1.5 or 2.5 ?

3.) what exactly means "best result" ? Do you prefer 1000$ profit after 500$ drawdown, or better 600$ profit with 100$ drawdown ? Do you prefer a system which made 2000 $ (first week to 2200, next 7 weeks down to 2000), OR do you prefer another system which made 100..200 $ each week (totally 1300$) ?

Yeah, probably it is needed to code a new program to assist mt4 in this process, anyway i agree that it can be done! The idea is not bad, but as you know the market is changing continiously, so a good way to let an EA be always in play is to re-optimize everyday, and here come the need of an automatic process. My ea do one operation every 4hour (or every 8 or 12 or 16..etc..), at the start of the 4hcandle it look if it is the case to enter or exit the market, and as soon as it taked or exited the position it wait another 4 hour or more, so we don't need a tickbytick 90% modeiling quality, the optimization (that one that may require 1days of CPU work) require 5-10minutes and not more (and the results are the same as 90% mod quality or forwardtest), my idea is to let the EA be overoptimized everyday, a good way can be to let the EA check at the 00.00 (for example) a xml file on a remote server (my office server) and download the settings from that file (like the news indicator), obviously in the other side (the server that will give the xml to the EA) there will be me that do the optimization day every day, or there can be another program that in conjunction with mt4 optimize and put results in the xml file totally automatically!

 
mcbalta:

4. Waves of forex market are changing year by year. If a system works one year, the next year it may fail. So, an expert must be educated for many years.

Exactly you are right, i think they are changin month by month too (maybe there is one month of low volatility and powerful downtrend, the next month is of totally choppy market with high volatity, etc.. an EA if optimized to the previous month, in the next month will have a trend-follow mentality, and will waste a lot of money in the choppy month), but if you look, the "change" from market condition to another is not something that happen in 1 minute, yes the market si continiously changing but it change slowly, that trader that is good and notice that there is finishing the trending period and starting the choppy period (that can dure one month or one week or one year, no difference) will change his strategy and have profits, that other trader that don't understand the change and continue to trade in a trend-following mentality (just in this example) will lost a lot of money, and at the end of the month will look the chart and say: "well, the market has choppied all this month, the last month it was going in downtrend with no choppy.. now i see clearly, i've traded the choppy month like if it was a trending month! what stupid that i am!".

If we optimize the ea day by day, the ea will understand and change day after day his trading strategy, from trending to choppy, and it will have profit in the first and in the second month too! (assuming that you have a good ea suitable to trade both trending and choppy market [obviously with different settings]).

This is what i mean, the market is continiously changing, it is a dynamic market, the ea's fails because they are not dynamics. But what if an EA become dynamic?

 

Help for merging tick data

Hi,

I'm looking for Delphi(or Java, or C#) developers to help me merge tick data I've collected. I have several computers with different internet providers logging every tick from 2 brokers. I want to merge all these ticks collected from the different computers in 2 databases (for each of the 2 brokers). The developer(s) who wants to help me will have access to all the tick data I've collected so far - from 1st January 2007. Please PM me or write me an e-mail: hiller159 [at] yahoo [dot] com

 

Thank you

FX_Babe

holyguy7:
Step by Step, How to get better Backtesting Results

1. Go download the MT4 Data for the currency pair you want to backtest found HERE. Make sure you download the M1 data. It should give you data for every minute all the way back into 2004 (about 1.5 years of backdata).

2. After you unzip the data on your Hard Drive, you need to import the data into Metatrader 4.

3. Open Metatrader 4 (Launch the program)

4. You need to go to your History Center in Metatrader 4. Hit F2 on your keyboard. Or Click on the top of Metatrader: Tools and choose History Center

5. Open Forex, Open Currency Pair to import and Open M1

6. Click Import and Browse to the location where you unzipped the Data for the currency pair.

7. Make sure File Type is on Metaquotes files. Click Open and OK. Then Close.

8. Now, in the Navigator window on the left side of your Metatrader 4 program, open up Scripts. It should be right below Custom Indicators.

9. Open the chart offline by going to File- Openoffline - SELECT and open the Pair on M1 Timeframe.

10. You should have the M1 Chart (offline) open of the currency pair. You need to Double click on Period Converter script.

10. Click Input tab and you should see the Value as 3. You need to change the value to 5 (M5), 15 (M15), 30 (M30), 60 (H1), 240 (H4), 1440 (D1).

11. Now, click Tools- Options- Charts tab and change the Max Bars in History and Max Bars in Chart to 999999999999 and click OK.

Basically, you are converting the M1 data that you imported into the different timeframes that you want to test. You can do one at a time to do all of them.

I usually start and choose 5 then click OK. Then I double click again on the Period Converter and change the value to 15 then click OK, then I click again and change the value to 30 then click OK, until I have completed the timeframes.

NOTE: It will give you a warning, "Do you really want to stop 'period_converter' and execute 'period_converter' on the chart M1?

Just click YES and then double click on the period_converter again to continue converting the M1 data to all timeframes.

I have done this with all currency pairs that I can download on all timeframes. It is good to have this as it gives you an idea if something is going to work or not.

I hope this helps.
 
w4rn1ng:
Hi, here is what i want to do:

I want to let my EA optimize himself (an optimization of the last 2 months), and it have to change his variables automatically if he found better variables during the optimization (it will be optimizing 24h/24, all the day, all the days).

Do you think it is possible to code something like this? maybe a script or something that i don't know, what do you think?

Here is a link to a Russian article that discusses auto-optimization of EAs.

Автоматическая оптимизация торгового робота в процессе реальной торговли - Статьи по MQL4

and is a link to a website to translate into english.

AltaVista - Babel Fish Translation

Wackena

 
Wackena:
Here is a link to a Russian article that discusses auto-optimization of EAs.

Автоматическая оптимизация торгового робота в процессе реальной торговли - Статьи по MQL4

and is a link to a website to translate into english.

AltaVista - Babel Fish Translation

Wackena

Hi, thank you for your reply, yeah i've already found it some weeks ago, anyway thank you for your help, that's a very good thing!

Reason: