MT4 Strategy Tester & Historical Data

 

Hi i have been trying to solve a problem with the strategy tester for the past few days but i now give up and ask you to help me.


Problem:

I am writing an EA and trying to test it with the strategy tester.

What happens is that the results on the chart do not agree with the with either the data held in the History or the EA/Program.

It appears to me that after extensive testing of the EA that the data is missing. But when i check the data it is there and the EA has not used it.

I am fairly sure that the data is correct. I have 1 minute data and i have generated all of the other 5/15/60 etc. timeframes. I have done this many, many times so i am certain that the data is correct.

It appears that the strategy tester is not using all of the data available to it. I have tested many timeframes.

Before you ask, i have tested the EA with debug messages and looked at the tester log files and this indicates that the data is not present in the log file?


So can anyone on here who knows the in/outs of the strategy tester and what it does (cos i dont) help me?

Many thanks,

Bob

 
crouch:


Hi i have been trying to solve a problem with the strategy tester for the past few days but i now give up and ask you to help me.


Problem:

I am writing an EA and trying to test it with the strategy tester.

What happens is that the results on the chart do not agree with the with either the data held in the History or the EA/Program.

It appears to me that after extensive testing of the EA that the data is missing. But when i check the data it is there and the EA has not used it.

I am fairly sure that the data is correct. I have 1 minute data and i have generated all of the other 5/15/60 etc. timeframes. I have done this many, many times so i am certain that the data is correct.

It appears that the strategy tester is not using all of the data available to it. I have tested many timeframes.

Before you ask, i have tested the EA with debug messages and looked at the tester log files and this indicates that the data is not present in the log file?


So can anyone on here who knows the in/outs of the strategy tester and what it does (cos i dont) help me?

Many thanks,

Bob




Can anyone out there help me with this?

 

We need more info, rather than the vague outline you've given. For example, there are several processes for creating history - which did you use? Phrases like "I have done this many, many times so i am certain that the data is correct" do not inspire confidence that you have indeed done it right. Are bars missing from the Visual mode?

What testing model are you using? Why won't you let us see "the results on the chart"? or what's in the log files? or the source for the EA? or the Debug messages?

Which time frames have you actually tested? what pair?

Have you tried the MA EA? does that behave as you expect? (It won't make money - oh that someone would prove me wrong!). If it didn't behave as you expected, then others could duplicate your tests & explain differences.

What price(s) does your EA use? If Close price, does it open trades mid-bar?

If your EA is so close to being the Holy Grail and you don't want to divulge it, then dumb it down a bit & see if it still behaves as you would expect, and share that if there's still a problem.

Yes, there are issues with the strategy tester, but most can be circumvented or accounted for one way or another, and I have no idea whether it's your price data, your config settings, your algorithm, or your lack of understanding of either the model or mid-bar price changes that is the cause.

I could ask another 100 questions, so don't think that if you answer these that you'll then get the exact perfect answer from me or someone else here.

For example, I just had my own EA fail to behave as expected. Why? because I had used ATR(1440) in my indicator to average price movement, and now using it in EA. Oops. Not 1440 bars of history in tester. If your EA had such an issue, it would be very hard to locate without seeing your source. FYI When I changed it to ATR(960), it worked as expected!

*TO ANYONE ELSE READING* If you can help out here with what's been stated and give specific reason for unexpected results, I retract my rantings and bow to your superior knowledge.

 


Hi Brewmans, and thanks for replying.

I will try and give you the answers that you are looking for.

1. It's not the holy grail, just an ea that is not doing as expected

2. I am using EURUSD 1 Hour chart

3. I downloaded data from MetaTrader5 and imported it into MetaTrader4 and then run a script to calculate all other timeframes.

I dont think that this is the problem as I can see data looking in History and it all looks to be present and correct

4. The problem is that the chart and the data look the same but the EA does not work as expected

5. It is not a problem of bars of data i.e. not enough data loaded.

The problem can be seen in the attached picture:

The three trades on the left all worked ok as expected.

30 pip take profit

30 pip take profit

50 pip stop loss

The next trade should stop out on the red arrow that i put on the chart, but does not stop out until the 16 Feb.

6. The strategy tester used the 1M data on the 1st pass, or that's what it said?


So i think that the EA is not doing as expected, but i don't know how the strategy tester works?

I have attached a picture and a cut down version of the EA.

Many thanks for your help.

Cheers, Bob



 
Picture
 
crouch:


Hi i have been trying to solve a problem with the strategy tester for the past few days but i now give up and ask you to help me.


Problem:

I am writing an EA and trying to test it with the strategy tester.

What happens is that the results on the chart do not agree with the with either the data held in the History or the EA/Program.

It appears to me that after extensive testing of the EA that the data is missing. But when i check the data it is there and the EA has not used it.

I am fairly sure that the data is correct. I have 1 minute data and i have generated all of the other 5/15/60 etc. timeframes. I have done this many, many times so i am certain that the data is correct.

It appears that the strategy tester is not using all of the data available to it. I have tested many timeframes.

Before you ask, i have tested the EA with debug message



Hi Bob,

if you are willing to invest some time into backtesting then goto http://eareview.net/tick-data and check out the awesome tutorial about backtesting and how to achieve results with a 99 % quality.

 
APeng:

Hi Bob,

if you are willing to invest some time into beacktesting then goto http://eareview.net/tick-data and check out the awesome tutorial about backtesting and how to achieve results with a 99 % quality.


Hi, yes i spent most of the weekend looking at this stuff, but with an EA that doesn't work it's tough to move on. I need to understand why my EA does not work before I go further.

Thanks anyway, all help is greatly appreciated ATM.

Cheers, Bob

 

ok, problem now solved, at the moment. I dont know what it was I just rewrote the EA from scratch and it now works!

Many thanks, Bob

Reason: