Errors, bugs, questions - page 2023

 
Kirill Belousov:

do you mean that function should be checked for override by type of incoming argument without const when declaring it?

or should the const variant be added to the ArrayMinimum system function template?

https://www.mql5.com/ru/docs/array/arrayminimum

int  ArrayMinimum( 
   const void&   array[],             // массив для поиска 
   int           start=0,             // с какого индекса начинаем поиск 
   int           count=WHOLE_ARRAY    // количество проверяемых 
   );
And Warning is inadequate.
Документация по MQL5: Операции с массивами / ArrayMinimum
Документация по MQL5: Операции с массивами / ArrayMinimum
  • www.mql5.com
//| Закрашивание основной части свечи                                | //
 
fxsaber:

https://www.mql5.com/ru/docs/array/arrayminimum

And Warning is inadequate.
The warning is clear from where - blundered and allowed a text array into operations intended for numerical values
 
Kirill Belousov:
It's clear why - we blinked and allowed a text array before operations intended for numeric values

Didn't blink, as I wrote a corresponding ArrayMinimum. But it is allowed and is not called for its own reasons. That's why this argument.

void OnStart()
{
  string Str[];
  
  int i = ArrayMinimum(Str); // Warning: possible loss of data due to type conversion
  ArraySort(Str); // Warning: expression has no effect
  ArrayFill(Str, 0, 1, 0); // Error: 'Str' - type mismatch
}

Wherever there are red ones, there must be yellow compiler messages. Red still manages to be different.

 
fxsaber:

Didn't blink, as I wrote a corresponding ArrayMinimum. But it is allowed and is not called for its own reasons. That's why this argument.

Wherever there are red ones, there must be yellow compiler messages. Red still manages to be different.

"blundered" is not in your court :)

I see it this way: Developers have fixed function names for operations with any arrays with system functions but they have implemented only work with numeric arrays so far.

But they have not put "stubs" on all the cases and it turns out that the user is getting messages "off-topic".

This should be corrected - I agree 100%.

 

Has anyone experienced this situation (MT4):

EA works on many charts (installed based on one template). Saved everything to a profile. Left to run on VPS around the clock.

Suddenly, on some of the charts is found when I open settings window that all string variables contain empty values. (Including fake ones - only to indicate settings section like "---TOUT FILTER---")

There were different terminals and EAs from different authors from Market.

I have not rebooted the terminals myself. I have not deliberately changed the settings.

 


Hello, can you please help me with my EA? I start to test it, it gives me an error 'array out of range in EA.mq4' (149,49). I think the error is in this line for (int li_8 = li_4; li_8 > 0; li_8--) aia_0[li_8] = aia_0[li_8 - 1]; If this part of code is removed in EA, tester is running, but EA does not open trade. Please advise how to change this code to make it work.

 
Ivan Lysenkov:


Hello, can you please help me with my EA? I start to test it, it gives me an error 'array out of range in EA.mq4' (149,49). I think the error is in this line for (int li_8 = li_4; li_8 > 0; li_8--) aia_0[li_8] = aia_0[li_8 - 1]; If this part of code is removed in EA, tester runs, but EA does not open trade. Please advise how to change this code to make it work.

Are you working with the decompile? Do you? There is a strict ban on any work and discussion of stolen code on this resource.

 
Kirill Belousov:

Has anyone experienced this situation (MT4):

EA works on many charts (installed based on one template). Saved everything to a profile. Left to run on VPS around the clock.

Suddenly, on some of the charts is found when I open settings window that all string variables contain empty values. (Including fake ones - only to indicate settings section like "---TOUT FILTER---")

There were different terminals and EAs from different authors from Market.

I have not rebooted the terminals myself. I have not deliberately changed the settings.

I should have saved the template when I encountered it.

 
fxsaber:

Should have kept the template when confronted.

I don't get it.

I just put the EA on the chart. I set the required settings and save it as a template.

What I mean by that is that all the charts had identical settings. Some of them have zeroed out string variables in settings later.

I detected it by accident - comments on the trades have stopped appearing


I have applied to SD back in April. But they were unable to reproduce the situation, as I found out today after my request.

I've since stopped being confident in the reliability of string parameters in extern.

Here's how immediately after applying the template:


Here's how after the glitch was triggered


Here is a comparison in program of charts with glitched EA and the chart with no glitch (both were opened by the same template)


 
Kirill Belousov:

I don't get it.

It was interesting to see the saved template after the glitch. I think you showed it in the last screenshot.

Write an EA that reads the input parameters of all running EAs and signals when the input parameters have changed. Then you will be able to track it.