Backtesting/Optimization - page 15

 
Ducati:
Herbert,

Yes, it did change immediately after build 200 was downloaded! I completely forgot that it downloaded a new build.

I also just downloaded a brand new version of metatrader from the metatrader website and it is version 4 build 200 and it will not let me import the historical data from Alpari. I select the file, but nothing happens. This sucks!

You can say that again.

I filed a bug report at MetaQuote, but did not receive any respons on that.

Similar questions in MetaQuote forum are just answered with: "It has been improved" well I doubt if it's only us that are having problems with this behavior.

To be honest: If something realy has been improved and I should redo all my experts optimisation, I would take deep breath and do it, but this imported data is not compatible with all my previous tests.

It should still allow us to choose between the new download method (from MetaQuote?) and importing from another source like Alpari.

 

Luckily I still have build 198 on my computer. I am just going to copy that folder.

 

Get 99% Modeling quality

I did see this in another forum. Is this something we can use?

Paul Dawidowicz 16.11.06 05:46

Slawa,

I used to generate a fxt file from tick data and then move it to the history directory so then I got 99% Modeling quality.

with the new update it ignores the generated fxt file, and the quality on the same EA, M1 went down to 25%

the last version 198 was good now I dont know what to do with the tick data I have and would like to use to backtest

Slawa 16.11.06 10:32

Change version of fxt to 403.

 

The Phoenix thread has an excellent guide on backtesting EA as well.

Now that build 200 is out, you don't need to worry about downloading the quote history manually anymore.

https://c.mql5.com/forextsd/forum/162/phoenix-2007-how-to-optimize-phoenix.pdf

 

it's a bug: metatrader overwrites it.

rightclick your fxt data file and set 'only reading' in property tab, this will prevent from deleting it, this way I'm able to get tick data working with build 200 also.

do you know how can I get higher tf than 1 minute? any script?

 

The proper way to Backtest from Alpari's Databank

Got this off another site and want to make sure you guys are backtesting with the correct Data from the Alpari Databank;

There seems to be a lot of confusion about reliability issues and how to go about achieving the most accurate possible results. I am not a programming or trading guru, but I believe I can provide a helpful little FAQ on backtesting using MT4.

Good backtesting is important when considering a system-trading approach, because you want to have some idea of the feasibility of your idea before you go live with it [at least I do]. If you're backtesting with a 50% model quality, eh... you can't really be sure what's going on. If you have a 90% modeling quality, you can have more confidence on how your system actually would have performed.

+=========================+

|MCBoogs' MT4 Backtesting FAQ v1.0 |

+=========================+

Contents:

- Section 1: Is MT4 Backtesting Reliable?

- Section 2: Downloading/Importing/Converting 1M Data

- Section 3: Configuring the Backtester

- Section 4: Other Issues

Section 1: Is MT4 Backtesting Reliable?

This question often gets pretty heated and people even get to the point of flaming each other about it. Backtesting in MT4 can be reliable, but its reliability is contingent upon the data you are backtesting on. Demo account data that is streamed in through a demo account broker has gaps, holes, and is basically not suitable for testing.

When backtesting, you want to use the EVERY TICK MODEL and have accurate 1M data to get the most accurate test possible. The 1M data is important, because the EVERY TICK MODEL uses whatever the smallest available timeframe available is and "fakes" the movement of price within the smallest available bars. Having 1M data allows for the fractal interpolation within bars to occurs only within the very narrow range of 1M bars.

The easiest [and only] solution to this is to use good 1M data. The most complete data you can get [at least for free] is from Alpari's Databank. They have data in MT native format, on the 1M timeframe back through mid 2004. However, setting up the data for use requires some doing.

---------------------------------------------------------------------------

Section 2: Downloading/Importing/Converting 1M Data

(1) You need to modify MT4 to allow for more bars. Go into the Tools Menu, then go to Options [or just hit C+O]. Go into the charts tab and put in 9999999999999 for bars in history. MT4 will default to whatever it's maximum is.

[Note: The reason MT4 has a limited bar count to begin with is because more bars (particularly when used in backtesting models) means MT4 is going to eat up more HD space.]

(2) Download the 1M data from Alpari's Databank in whatever currency you're going to test on.

(3) Import the data into MT4 using the History Center. Go to Tools => History Center [or push F2]. Make sure you import it in proper currency and in the M1 timeframe. You don't want EURUSD data being important into USDCAD for instance.

(4) Convert the data using the period converter script included in MT4 [you only have 1M bars right now]. You have to open offline charts to do this.

-Go to the File Menu, then Open Offline, select the 1M data of the currency you need to convert. A chart will pop up with that data.

-Then drag & drop the period_converter script onto the offline chart. The ExtPeriodMultiplier int that you can modify is the multiplier you are applying to the chart. So making it 5, will convert 1M data into 5M data.

-For simplicity's sake, you need to run the period converter with the following integers to get all the backtesting timeframes: 5,15,30,60,240, and 1440.

[NOTE: you can also convert 1M data to timeframes not native to MT4 if you want to do some indicator analysis or something on another timeframe.]

Congratulations, you have now imported and converted data into MT4. Now, for the sake of illustrating one of my earlier points, open up a currency you have imported data on. Look at the difference in the bars from the downloaded data as opposed to data streamed in from a Demo broker [So, if you downloaded 1M data from July 04 to August 05, look at the chart at August 05's end and September 05's beginning]. You will notice that the bars (on every time frime if you have converted them properly) from your downloaded time period will be more complete.

------------------------------------------------------------------

Section 3: Configuring the Backtester

Now that you've succesfully imported complete data, there are a few more things you need to do to run a reliable backtest.

(1) Check the recalculate option the next time you run a backtest, because you need the backtester to utilize your shiny new happy data (which it won't do unless you tell it). Anytime you import new data, you need to recalculate (I recalculate every few tests just to feel safe, maybe its a reflection of internal confidence problems, but that's for another FAQ).

(2) Check the use date option and set the date range only over a time period where you have good reliable data. This way you're only backtesting the good stuff. It will be reflected in the modeling quality percentage.

(3) Make sure the model is set to EVERY TICK. If you're not, all this hard work we just did was for nothing. I addressed why we do this earlier in the FAQ.

------------------------------------------------------------------------

Section 4: Other Issues

MT4 is a work in progress, sometimes there are strange bugs that crop up in backtesting. However, usually when you think you have a bug on your hands, there is something wrong with your code. I can't emphasize enough how important debugging is. If you have problems, check your code first because it's probably the problem. If you really think you have a legit bug on your hands, post it to the MT4 forums.

Because you are not actually backtesting on every tick that happened [you are dealing with an interpolation on 1M data], it is still not a perfect reproduction of what actually happened in the markets. Because of this, 1M and 5M scalping EAs that get in and out of trades really quickly will run into some problems just because of this limitation. The longer timeframe you are trading on, the less likely your testing is to be hampered by this.

Well, that's all I can think of now. I read this over, I think I made everything clear and have the steps outlined correctly. If you notive a mistake, let me know, and I'll correct it in my next version of the MT4 Backtesting FAQ.

 

How do you backtest?

When I load my EA to backtest then go into the Expert Settings, why are there 4 separate options for each row?

EG: SL has Value, Start, Step and Stop ??

I just want to set SL to 15

Thanks

 
matrixebiz:
When I load my EA to backtest then go into the Expert Settings, why are there 4 separate options for each row?

EG: SL has Value, Start, Step and Stop ??

I just want to set SL to 15

Thanks

It is for optimization of the settings. For example:

sl=15

start from 5 with step 1 and stop with 20.

So if you are optimizing to find the better settings you will need it.

As to backtesting and optinization of the settings we have the following links:

- Backtest Modeling Quality;

- MetaTrader Strategy Tester, part 2;

- MetaTrader Strategy Tester, part 1;

- - M1 Tick by Tick Data for BackTesting.

Make sure that you have data enough to backtest with 90% modelling quality.

 

MT4 backtest data - where does it come from

Hi

MT4 version 200 now has the capability to download 1 minute history from 1999. Wonderful for testing long term any strategies. The problem is, if I backtest on this data, can I duplicate the results on any real data feed? Is this data sourced from a broker that we can get a representative live feed from?

To clarify, can I sign up to a broker and get that same data as a live feed? I have found that small differences in different brokers data can make big differences in profit/loss levels. If I backtest something and it makes a profit, then if I can trade live on the same data, there is a chance it will make a profit.

 
tururo:
Hi

MT4 version 200 now has the capability to download 1 minute history from 1999. Wonderful for testing long term any strategies. The problem is, if I backtest on this data, can I duplicate the results on any real data feed? Is this data sourced from a broker that we can get a representative live feed from?

To clarify, can I sign up to a broker and get that same data as a live feed? I have found that small differences in different brokers data can make big differences in profit/loss levels. If I backtest something and it makes a profit, then if I can trade live on the same data, there is a chance it will make a profit.

As I understand this build 200 so I think the data is coming from somewhere. I think it is not your or my broker's data.

That is why I am using Alpari data (for backtesting/optimizing) up to now.

People who know this subect better may corect me if I am wrong.

Reason: