confusing with optimization result !

 

Hi, I’m really confused.
In MetaTrader 5, I have a parameter named "astane" that I want to optimize.
The first time, I set it to start at 0.7 and go up to 0.8 with a step of 0.1.
The second time, I set it to start at 0.8 and go down to 0.7 with a step of -0.1.
The results differ significantly between the two tests!!!!
The modeling method is identical for both tests (set to "Every tick"), the testing timeframe is the same, and I am using the "Slow complete algorithm."
Please take a look at the screenshots.
I would appreciate your help.



optimize1



optimize2

Files:
opt1.jpg  600 kb
opt2.jpg  661 kb
 
masoodbabagoli:

Hi, I’m really confused.
In MetaTrader 5, I have a parameter named "astane" that I want to optimize.
The first time, I set it to start at 0.7 and go up to 0.8 with a step of 0.1.
The second time, I set it to start at 0.8 and go down to 0.7 with a step of -0.1.
The results differ significantly between the two tests!!!!
The modeling method is identical for both tests (set to "Every tick"), the testing timeframe is the same, and I am using the "Slow complete algorithm."
Please take a look at the screenshots.
I would appreciate your help.

Negative step values are excluded from the official Help page (https://www.metatrader5.com/en/terminal/help/algotrading/strategy_optimization), so I question whether negative step values are valid in an Optimization.

Additionally, the following Simulated annealing algorithm uses custom code to detect negative step values:

Articles

Controlled optimization: Simulated annealing

Aleksey Zinovik, 2018.03.19 12:41

The Strategy Tester in the MetaTrader 5 trading platform provides only two optimization options: complete search of parameters and genetic algorithm. This article proposes a new method for optimizing trading strategies — Simulated annealing. The method's algorithm, its implementation and integration into any Expert Advisor are considered. The developed algorithm is tested on the Moving Average EA.
bool AnnealingMethod::VerificationOfVal(double start,double end,double val)
  {
   if(start<end)
     {
      if((val>=start) && (val<=end))
         return true;
      else
         return false;
     }
   else
     {
      if((val>=end) && (val<=start))
         return true;
      else
         return false;
     }
  }

The method takes into account that the parameter changing step may be negative, therefore, it checks the condition "start<end".