Conditional Parameter Optimization solution needed!

Mohammad Hossein Najarzadeh  

Hello Everyone

I have a problem in optimization passes. I've searched a lot but non of questions nor the answers in the forum was the
one solving this problem.


The problem is that i have some bool parameters in my inputs which when they are set as false there is
no need to optimize some other parameters.

for example if the "Psar_Active" parameter is set to false my EA won't use Parabolic SAR indicator  in it's decision making process,
so optimizing the "step" and "max"  (two other input parameters) of the indicator is useless (only when the Activation parameter is false).

unfortunately i couldn't find a way for this. so many of the optimization results are useless
and this make the whole optimization much less effective.

Lets assume that "Step" Parameter has 5 steps and "Max" Parameter has 4 steps the total steps considering the
"Psar_Active" parameter (which has two steps) is currently resulting to 40 passes (5*4*2), which 19 of them are useless
(the ones with 
"Psar_Active" ==false). if this problem could be solved the total passes should be reduced to 21 (5*4*1+1).

I would be great-full if we can figure this out. thank in advance for your help.

Mohammad Hossein Najarzadeh  
Zee Zhou Ma:

I see. There will be redundant passes. I think this is something which can be addressed to service support. 

This looks more like a feature request, rather than something which can be solved on the forum. 

Maybe a moderator can answer to this.

Hi

Thanks for your reply. I really didn't catch what you said.

a moderator?

how can i get in touch? 

I've already posted an order, on the freelance section but so far was not successful.   https://www.mql5.com/en/job/91806

Freelance service at MQL5.com: Conditional Parameter Optimization solution needed
Freelance service at MQL5.com: Conditional Parameter Optimization solution needed
  • www.mql5.com
I have a problem in optimization passes. I've searched a lot but non of questions nor the answers in the forum was the one solving this problem. The problem is that i have some parameters in my inputs which when they are set as  there is no need to optimize some other parameters. for example if the "" parameter is set to my EA won't use...
[Deleted]  

Just wait for a moderator to reply to your thread or you can send the problem to service desk yourself.

I think this is a feature request to enhance the MT5 optimization tool to have "Conditional Parameter Optimization", rather than simply doing code changes.

I doubt code changes will produce the effect that you want, and I also doubt in the short to medium term, you will have the solution ready to your issue.

There will always be a forum moderator around. He is more experienced in issues than any of the forum members.

William Roeder  
Mohammad Hossein Najarzadeh: if the "Psar_Active" parameter is set to false ... the "step" and "max"  (two other input parameters) of the indicator is useless
input bool Psar_Active=...

#define STEP_DEFAULT=0.02;
input double step=STEP_DEFAULT;

#define MAX_DEFAULT=0.20;
input double max=MAX_DEFAULT;

:
if(!Psar_Active && (
   step != STEP_DEFAULT ||
   max  !=  MAX_DEFAULT )) return INIT_PARAMETERS_INCORRECT;
ddchbm  

I have the exact same need as the OP:

If certain boolean input values are false, it negates the need for certain other inputs to be tested at all.

Currently wasting time, computing resources, and yes even cloud network budget ($) testing useless/irrelevant input parameters.

... Being that it has been some 3 years since this was posted, perhaps there have been some updates regarding this much needed feature (or a suitable workaround)?

Thanks much! =)

William Roeder  
ddchbm #: (or a suitable workaround)?

The workaround was given.

salvatoreone  
William Roeder #:

I used Williams code to "develop" below. I thought I could share with everyone who is visiting this topic to find solution.


Just modify as required obviously, it's just an example of how this could be implemented.

input group "Trailing Stop";
const input int    iprofitToTrigger = 30;
const input double iprofitIncreaseToTriggerAgain = 0.05;
const input double iprofitToTake = 0.2;
const input bool   iincreaseProfitToTake = true;
const input double iincreaseUntil = 0.7;
const input double iincreaseBy = 0.05;

// Check input parameters
bool CheckOptimisationParameters()
{
// in the OnInit check for true/false and return ( INIT_PARAMETERS_INCORRECT ); if false
// this ends EA early and stops optimiser from running this set of parameters. Copy below to OnInit():
// if( CheckOptimisationParameters() == false ) return ( INIT_PARAMETERS_INCORRECT );

// input group "Trailing Stop";
   if ( iprofitToTake + iincreaseBy >= 1 ) return (false);
   if ( iprofitToTake + iincreaseBy >= iincreaseUntil ) return (false);
   if ( iincreaseUntil >= 1 ) return (false);


   return ( true );
}

int OnInit()
{
   if( CheckOptimisationParameters() == false ) return ( INIT_PARAMETERS_INCORRECT );

   return(INIT_SUCCEEDED);
}
Reason: