I have problem to execute my EA in strategy tester

 

Hi, Every one,

I wrote an EA, that do some calculation on some previous candles in requested symbol and let me know the result that shown by percent.

I can see the result in expert tab when I run my EA, and there is no problem.

When I run it on strategy tester I got message that I defined it in my EA that let me know there is not enough bars to proceed, But as a matter of fact in this situation I got correct result in my EA.

I attached my EA,Please help me to solve my problem.

Thanks in advance.

Files:
ex_ad.mq4  22 kb
 
saffarmoh:

Hi, Every one,

I wrote an EA, that do some calculation on some previous candles in requested symbol and let me know the result that shown by percent.

I can see the result in expert tab when I run my EA, and there is no problem.

When I run it on strategy tester I got message that I defined it in my EA that let me know there is not enough bars to proceed, But as a matter of fact in this situation I got correct result in my EA.

When a Strategy Tester chart is created it is not populated with all the history previous to your start date as would be on a Live/Demo chart,  you have to take this into account and work around it.
 
RaptorUK:
When a Strategy Tester chart is created it is not populated with all the history previous to your start date as would be on a Live/Demo chart,  you have to take this into account and work around it.

Thank you very much for your fast answering.

As a matter of fact I need to consider at least the previous one or two weeks candles in 1, 5 and 15 Min, and these two results (SL_percent and TP_percent)  are crucial to run my EA. In my main EA I have more than 7 variables that should be optimized in strategy tester.

May you explain the solution step by step.

Thanks in advance again.

 
saffarmoh:

Thank you very much for your fast answering.

As a matter of fact I need to consider at least the previous one or two weeks candles in 1, 5 and 15 Min, and these two results (SL_percent and TP_percent)  are crucial to run my EA. In my main EA I have more than 7 variables that should be optimized in strategy tester.

May you explain the solution step by step.

Solution ?  what solution ? the solution to your problem ?  isn't that your task ?
 
RaptorUK:
Solution ?  what solution ? the solution to your problem ?  isn't that your task ?


Hi Simon,


Sorry, Now I've got your point.

I modify my EA, and create more than one week history for strategy tester by using time delay preparation.

If you run it on strategy tester you will distinguish (by reading journal information of strategy tester) that the time is stopped and I consider that EA doesn't continue without any acceptable fact.

May you explain that what the problem is.

Files:
ex_ad_1.mq4  23 kb
 
saffarmoh:

Hi Simon,

Sorry, Now I've got your point.

I modify my EA, and create more than one week history for strategy tester by using time delay preparation.

If you run it on strategy tester you will distinguish (by reading journal information of strategy tester) that the time is stopped and I consider that EA doesn't continue without any acceptable fact.

May you explain that what the problem is.

Why don't you try this:  wait and let time pass until there is enough history on the ST chart to suit your needs.  You don't need a special EA for testing, just check IsTesting() if it returns true the EA is running in the ST,  then check how much history is on the chart,  if it's not enough return(0);
 

Thank you very much to follow my problem Simon.

I did your suggestion,and I inserted print command to view current time of EA execution. As you will see the time is stopped during finding requested percents in my EA and my problem have not been solved yet,

Thanks again

Files:
ex_ad_1_1.mq4  23 kb
 
saffarmoh:

Thank you very much to follow my problem Simon.

I did your suggestion,and I inserted print command to view current time of EA execution. As you will see the time is stopped during finding requested percents in my EA and my problem have not been solved yet,

Thanks again

I don't see the return when you find there are not enough bars on chart ?
 
RaptorUK:
I don't see the return when you find there are not enough bars on chart ?


Thank you very much Simon.

I thought that I got your point,But it does not work.

Please modify my EA

Thanks again
Files:
ex_ad_12.mq4  23 kb
 
saffarmoh: Please modify my EA
Who do you think you are? There are no slaves here, you have only three choices: Search for it, learn to code it, or pay someone. We're not going to code it FOR you. We are willing to HELP you when you post your attempt and the nature of your problem.
 

Hi william,

Thank you very much for your straight forward answer. I try to solve my problem, I thought this forum is place for association some problems.

If you may solve my problem,I will pay you off course.

Thank you very much.

I am looking forward to hearing from you as soon as possible.

 

Reason: