Download MetaTrader 5
To add comments, please log in or register
Deposit to your account in any convenient way. There are 4 of them here!
Dua Yong Rew
5102
Dua Yong Rew 2012.09.08 05:52 

What can I do to skip some of the parameters in strategy tester?

 

Example

Input A Start 0, Step 10, Stop 100

Input B Start 0, Step 10, Stop 100

 

If input B is more than input A then skip optimization. 

Dua Yong Rew
5102
Dua Yong Rew 2013.03.27 02:28  

Anyone know how?

I'm currently using this code in my ontick()

if(input b > input A)  return;

optimization still run and return me 0, can I actually skip that? 

Alain Verleyen
Moderator
28517
Alain Verleyen 2013.03.27 08:54  
doshur:

Anyone know how?

I'm currently using this code in my ontick()

if(input b > input A)  return;

optimization still run and return me 0, can I actually skip that? 

Try to put your "if" statement in OnInit().
Slawa
Moderator
6675
Slawa 2013.03.27 09:46  
angevoyageur:
Try to put your "if" statement in OnInit().
And OnInit return value should be set to INIT_PARAMETERS_INCORRECT
Alain Verleyen
Moderator
28517
Alain Verleyen 2013.03.27 09:59  
stringo:
And OnInit return value should be set to INIT_PARAMETERS_INCORRECT
Thank you stringo for that clarification.
Kourosh Davallou
35169
Kourosh Davallou 2013.03.27 12:26  
stringo:
And OnInit return value should be set to INIT_PARAMETERS_INCORRECT

Hi Thank you stringo 

can  you write sample code ? 

Alain Verleyen
Moderator
28517
Alain Verleyen 2013.03.27 12:46  
kourosh1347:

Hi Thank you stringo 

can  you write sample code ? 

It is not good to be lazy :-)

Place code like this in your OnInit() function:

if (input b > input A) return(INIT_PARAMETERS_INCORRECT);
Dua Yong Rew
5102
Dua Yong Rew 2013.03.27 17:13  

Thanks a lot. This code sure save some time for my optimization.

:) 

Slawa
Moderator
6675
Slawa 2013.03.28 06:32  
doshur:

Thanks a lot. This code sure save some time for my optimization.

:) 

You are welcome
Dua Yong Rew
5102
Dua Yong Rew 2013.04.01 05:35  

works but

2013.04.01 11:35:34 Core 8 pass 149 tested with error "Incorrect input parameters" in 16 ms

still took 16 ms?

/
To add comments, please log in or register