Errors, bugs, questions - page 221

 
vikulin:

this is the same result! the input parameters for these points are the same!

Please explain. I don't understand about "the input parameters for these points are the same". As far as I understand how the optimizer works, each pass corresponds to a unique set of input parameters. Or do you mean that when using the genetic algorithm there may be situations when a unique set of input parameters can be processed by the optimizer several times?

...Well, yes, that's exactly what you're saying. Then it turns out that all subsequent points "from the cache" are just a fiction, distorting the visual perception of optimization results?

 
sultanm:

Strange. This is the third time. There are two points on the graph that are close in value, but there is only one in the results.

Hint: Please sort by the requested value, and don't forget to show the vertical scroll bar of the table.

 

Will this problem ever be solved???

This is the third time I've talked about it and there's no reaction!


 
vikulin:


By the way, it seems to me that if the modeling of requotes is selected, then this cache should not be used. what do the developers think about it?

and another bug: when my genetic algorithm went beyond 10496, the graph began to display incorrectly - vertically it scaled correctly, you could understand that higher results were found, but horizontally it was not updated. points as if they were added somewhere on the right, already outside the graph.

Please write to servicedesk. And in point 2 is interested in complete information. EA, terminal build, optimization settings...
 
Code:
int symbols = SymbolsTotal(false);
for (int i=0; i<symbols; i++) {
   Print("Символ №"+i+" значение="+SymbolName(i,false));
}

In the terminal the result

2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №11 значение=GBPJPY
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №10 значение=GBPCHF
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №9 значение=EURJPY
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №8 значение=EURCHF
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №7 значение=EURAUD
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №6 значение=EURGBP
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №5 значение=AUDUSD
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №4 значение=USDCAD
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №3 значение=USDJPY
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №2 значение=USDCHF
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №1 значение=GBPUSD
2010.12.06 13:18:49   Expert (EURUSD,H1)    Символ №0 значение=EURUSD

Result in tester:

2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №11 значение=USDJPY
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №10 значение=USDCHF
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №9 значение=USDCAD
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №8 значение=GBPUSD
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №7 значение=GBPJPY
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №6 значение=GBPCHF
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №5 значение=EURUSD
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №4 значение=EURJPY
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №3 значение=EURGBP
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №2 значение=EURCHF
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №1 значение=EURAUD
2010.12.06 13:21:20     Core 1  2010.11.01 00:00:00   Символ №0 значение=AUDUSD

All the beauty of the SymbolName(i) function is lost

 
vyv:

A request to the developers. While the work on MT5 is boiling and changes are still being made, it would be very nice to expand the number of optimization passes.

As far as I understood the solution for many tasks is found for about 10 000 variants may be a little more or a little less. A few hours of searching on one processor and the best variants have been found.

Versatility of MQL5+OP+Multicore testing allows us to look at new horizons of tasks (e.g. searching for patterns) that can be solved using MT5 tools.

But here is the trouble:

The article posted on your site has an example of genetic algorithm https://www.mql5.com/ru/articles/55 where it took 3^100 forward brute force to solve a search problem on 100 bars - well that's a bit more than LongInt :) while the solution was found in 17 000 iterations. Genetic algorithm can find solutions for much more variants than LongInt. And this limitation is completely unfounded and obsolete. Well, except that at this final stage of MT5 it will be difficult to do so.

A very big request to the developers, if it is not too difficult, please make the number of passes at least 2^LongInt (2 to the power).

Will someone give me an answer?
 

Code:

//+------------------------------------------------------------------+
//|                                                      testInd.mq5 |
//|                                                                  |
//|                                              https://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright ""
#property link      "https://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
   int handle1 = iMA(NULL,0,17,0,MODE_LWMA, PRICE_CLOSE); //
   int handle2 = iMA(NULL,0,17,0,MODE_LWMA, PRICE_CLOSE); //абсолютно идентичные параметры
   if(handle1 == INVALID_HANDLE) {
                Print("Error Creating Handles for indicators",GetLastError());
        } else {
                Print("Handle1 ="+handle1);
        }
        if(handle2 == INVALID_HANDLE) {
                Print("Error Creating Handles for indicators",GetLastError());
        } else {
                Print("Handle2 ="+handle2);
        }
        
   IndicatorRelease(handle2);
   handle2 = INVALID_HANDLE; //добавил для "надежности"
   handle2 = iMA(NULL,0,33,0,MODE_LWMA, PRICE_CLOSE); //другой период
        if(handle2 == INVALID_HANDLE) {
                Print("Error Creating Handles for indicators",GetLastError());
        } else {
                Print("Измененный? Handle2 ="+handle2); //все обращения к данным handle2 возвращают данные с handle1
        }
   
   
//---
   return(0);
  }

Log:

2010.12.06 18:07:52:52 testInd (EURUSD,H1) Modified? Handle2 =10
2010.12.06 18:07:52 testInd (EURUSD,H1) Handle2 =10
2010.12.06 18:07:52 testInd (EURUSD,H1) Handle1 =10

Therefore, all data calls to handle2 are equivalent to calls to handle1, despite the changed period.

When the Expert Advisor is running, it is possible to create indicators with the same characteristics and such optimization for one handle is reasonable, but such "sticking" of a handle to a variable is very annoying.

P.S. I have found out the reason. This bug is a consequence of optimization to one handle number.

IndicatorRelease(handle2); //уменьшает счетчик хендлов на единицу и в итоге следующий созданный хэндл(с любой переменной) - опять 10
 
Vigor:

Code:

Log:

2010.12.06 18:07:52 testInd (EURUSD,H1) Modified? Handle2 =10
2010.12.06 18:07:52 testInd (EURUSD,H1) Handle2 =10
2010.12.06 18:07:52 testInd (EURUSD,H1) Handle1 =10

Accordingly, all calls to handle2 are equal to calls to handle1, although the period is changed.

During the operation of an EA, we cannot rule out the creation of indicators with the same characteristics, and such optimization for one handle is reasonable, but such "sticking" of a handle to a variable is very annoying.

P.S. I have found out the reason. It is a bug - the consequence of optimization to one handle number.

What makes you think it's a bug?

 
alexvd:

What makes you think it's a bug?

Good. It is a feature. But one you should know better.

If a user enters period values for MA from the interface, creates handles for indicators and uses values of indicator buffers, then having created (for example, I have default settings in this form) 2 indicators with the same characteristics (their handles are stored in the object wrapper), he/she receives the handle number of the first indicator, because of this feature.

The following is a possible chain of events.

Situation 1. it deletes the first indicator (and the program performs IndicatorRelease); as a consequence, the second indicator doesn't work automatically - buffer copying error.

Situation 2. It removes second indicator (and program does IndicatorRelease), handwheel counter decreases. First one is doing fine. It creates a third indicator with a different period. It receives the handle count+1 i.e. the handle number of the just deleted indicator. In the end, the worst thing is that the third indicator with a different period, successfully created, gives the values of the first indicator, still not deleted, to the buffer.

Handle number gluing feature, leads to ambiguous situations when deleting one of two glued ones and then creating new ones.

//+------------------------------------------------------------------+
//|                                                      testInd.mq5 |
//|                                                                  |
//|                                              http://www.mql5.com |
//+------------------------------------------------------------------+
#property copyright ""
#property link      "http://www.mql5.com"
#property version   "1.00"
//+------------------------------------------------------------------+
//| Expert initialization function                                   |
//+------------------------------------------------------------------+
int OnInit()
  {
//---
   
   int handle1 = iMA(NULL,0,17,0,MODE_LWMA, PRICE_CLOSE); //
   int handle2 = iMA(NULL,0,17,0,MODE_LWMA, PRICE_CLOSE); //абсолютно идентичные параметры
   if(handle1 == INVALID_HANDLE) {
                Print("Error Creating Handles for indicators",GetLastError());
        } else {
                Print("Handle1 ="+handle1);
        }
        if(handle2 == INVALID_HANDLE) {
                Print("Error Creating Handles for indicators",GetLastError());
        } else {
                Print("Handle2 ="+handle2);
        }
        
   IndicatorRelease(handle2);

   handle3 = iMA(NULL,0,33,0,MODE_LWMA, PRICE_CLOSE); //другой период
        if(handle3 == INVALID_HANDLE) {
                Print("Error Creating Handles for indicators",GetLastError());
        } else {
                Print("Новый handle3 ="+handle3); //все обращения к данным handle3 возвращают данные с handle1
        }
   
   
//---
   return(0);
  }
 
vyv:
Will someone answer it for me?

It's been talked about here.https://www.mql5.com/ru/forum/1997/page6/#comment_31644

Maybe it would be better to move the question there - a suggestion.

Оптимизация в Тестере стратегий
Оптимизация в Тестере стратегий
  • www.mql5.com
из которых ТОЛЬКО 546 ms было затрачено именно на тестирование эксперта.
Reason: