Download MetaTrader 5

Enum parameters are different in optimizing and testing

To add comments, please log in or register
Join MQL5 Cloud Network. Improve your rating!
Tomas Hruby
4781
Tomas Hruby 2016.01.18 00:06 

Hi Guys,

 I am using enum values for my Input parameters and it seeme there is a bug because I am getting nice results while optimizing.
But when I try to use optimization results for testing (no method changed) the result is absolutely different.

Its looks that its made by enum parameters because optimizing using enum differently than testing.

Tom 

Stuart Browne
5802
Stuart Browne 2016.01.18 00:18  
Tomas Hruby:

Hi Guys,

 I am using enum values for my Input parameters and it seeme there is a bug because I am getting nice results while optimizing.
But when I try to use optimization results for testing (no method changed) the result is absolutely different.

Its looks that its made by enum parameters because optimizing using enum differently than testing.

Tom 

Hi Tom

Strange. Can't say I've ever seen a problem with input enums, and I use them pretty much constantly. The only way we could really help you verify is if you post up your code mate.

Cheers
Tomas Hruby
4781
Tomas Hruby 2016.01.18 08:48  
Stuart Browne:
Hi Tom

Strange. Can't say I've ever seen a problem with input enums, and I use them pretty much constantly. The only way we could really help you verify is if you post up your code mate.

Cheers

Thanks for fast response.

The problem is between optimization and testing (MT4). I had never different result of optimization and visual mode of one reults. The problems started when I used enum.

Optimization and used settings:

 Used settings have no same results as in opitmization.

 

 

Settings:

 

 

 I am using this in code:

enum eDay{
   Dx=-1,    // Not set
   D0=0,     // Sunday
   D1=1,     // Monday
   D2=2,     // Tuesday
   D3=3,     // Wednesday
   D4=4,     // Thursday
   D5=5,     // Friday
};

extern eDay    ECR_DisableDay        = Dx;

//Function for program and other int parameters / excluded day function (enum to int)
int eDayToInt(eDay fDay){
   if(fDay==D0){ return(0); 
   }else if(fDay==D1){ return(1);
   }else if(fDay==D2){ return(2); 
   }else if(fDay==D3){ return(3); 
   }else if(fDay==D4){ return(4); 
   }else if(fDay==D5){ return(5); 
   }else{
      return(-1);
   }
}

 But I am worried about the same type of working in optimization and in testing.


Or it could be caused by lenght of settings string? When I right click on Set Input Parameters (at selection optimization results) does all parameters are copied to input form? Because when I click Copy and then pasting them to notepad, they are cutted after 964 chars.

 

Copying input parameters (are cutted):

 

Tomas Hruby
4781
Tomas Hruby 2016.01.18 10:29  

Hi all,

it looks that problems are caused by small caps in the name of ENUM parameter and its values names.

I make this and now its the same in optimization and testing:

enum ENUM_DAY{
   D0=0,     // Sunday
   D1=1,     // Monday
   D2=2,     // Tuesday
   D3=3,     // Wednesday
   D4=4,     // Thursday
   D5=5,     // Friday
   DX=-1,    // Disabled
};
Stuart Browne
5802
Stuart Browne 2016.01.18 11:46  
Tomas Hruby:

Hi all,

it looks that problems are caused by small caps in the name of ENUM parameter and its values names.

I make this and now its the same in optimization and testing:

Even stranger Tom. I use mixed caps in ENUM without problems. But as long as your problem is solved... :)
Alain Verleyen
Moderator
30727
Alain Verleyen 2016.01.18 23:27  
Stuart Browne:
Even stranger Tom. I use mixed caps in ENUM without problems. But as long as your problem is solved... :)
It's just a coincidence
Alain Verleyen
Moderator
30727
Alain Verleyen 2016.01.18 23:32  
Tomas Hruby:

Hi Guys,

 I am using enum values for my Input parameters and it seeme there is a bug because I am getting nice results while optimizing.
But when I try to use optimization results for testing (no method changed) the result is absolutely different.

Its looks that its made by enum parameters because optimizing using enum differently than testing.

Tom 

The difference comes from a change in your trading environment. Most often it's the spread, but it can be other symbol settings.
To add comments, please log in or register