Errors, bugs, questions - page 594

 
Interesting:

The developers will in any case ask to localise everything, create an application to the SR, attach an expert and describe everything in as much detail as possible.

They are the developers (you know them) and telepathists are having a rest today. :)

That's OK.)) Now I will localize it.))

Telepathy has nothing to do with it. The point is that such an error I have for the first time, and I thought it occurs in some specific cases, and I can at least advise on the forum in which cases it may be, and then I myself will sort it out.

That is, I would like to know, Access violation write (0x-code) and Access violation read (0x-code) in what cases occurs? I haven't touched this program for about a month. It means that this issue may have started occurring after some build. Perhaps developers have tightened checks and now they need to write the code more correctly. Only where to look for an error in ~20 000 code lines? )))

 
tol64:

It's okay.)) I'll localize it now.))

Telepathy has nothing to do with it. The thing is that this kind of error I have the first time, and I thought that it occurs in some specific cases, and I can at least suggest on the forum, in which cases it may be, and then I'll deal with it myself.

That is, I would like to know, Access violation write (0xcode) and Access violation read (0xcode) in what cases occurs? I haven't touched this program for about a month. It means that this issue started occurring after some build. Perhaps developers have tightened checks and now they need to write the code more correctly. Only where to look for an error in ~20 000 code lines? )))

Try to convert it into C and the error will be found by itself. And in general - with such projects it's the only way to write, if you don't want problems in the future. Unfortunately, I understood it too late myself and now I'm rewriting it :)
 

Gentlemen, please advise what is a compact way (maybe functions exist) to identify the largest/smallest value of one of the existing buffers? Not just identifying, but also determining what is the buffer with the largest/smallest value.

Suppose we have 4 buffers, then the simplest thing that comes to mind is to compare first the 1st one with the others (like if(one[0]<two[0] && one[0]<three[0]&& ...etc.). If it is false, then compare the second one in the same way and so on. But this is a bit cumbersome.

 
Cmu4:

Gentlemen, please advise what is a compact way (maybe functions exist) to identify the largest/smallest value of one of the existing buffers? Not just identifying, but also determining what is the buffer with the largest/smallest value.

Suppose we have 4 buffers, then the simplest thing that comes to mind is to first compare the first one with the others (like if(one[0]<two[0] && one[0]<three[0]&& ...etc.), then compare the second one the same way and so on. But this is a bit cumbersome.

ArrayMinimum returns the index of the minimum array value; the same is true for ArrayMaximum.

If you want to compare several buffers, you can get the extreme values and then compare them using if or fmin, fmax.

 
Cmu4:
Do you think this method requires less resources than the simple brute force I wrote above?

No way,

although no, if the arrays to be searched are 3-4 bars long and the arrays are 2-3, it will be faster.

 
Urain:

ArrayMinimum returns the index of the minimum value of the array, and ArrayMaximum works in a similar way.

If you want to compare several buffers, you can get extreme values and then compare them using if or fmin, fmax.

I've just read the function descriptions...

ArrayMinimum is another example, as I need to compare the value of 0 bar and don't need search of array history.

fmin only compares two buffers, what's the point of it? I may as well use the standard if. But then you get a lot of conditions... 4 complex ones for minimum and the same number for maximum...

 
Cmu4:

Now I've read the function description...

ArrayMinimum is from another direction - as I need to compare value of 0 bar, and I don't need array history search.

fmin only compares two buffers, what's the point of it? I may as well use the standard if. But then you get a lot of conditions... 4 complex ones for the minimum and the same number for the maximum...

fmin isn't comparing buffers, it's comparing two values.

Now your task is clear, you need to find an extremum among parallel values of different buffers.

Now answer, do you need this only for zero values ? or do you need to repeat this action for many parallel values ?

 
Urain:

fmin is not comparing buffers but two values.

Now your task is clear, you need to find the extremum among the parallel values of the different buffers.

Now answer do you need this only for zero values ? or does this action need to be repeated for many parallel values ?

It is necessary for an Expert Advisor that trades from the market. Thus, we need to compare the values of all buffers on the current bar.

Here is a screenshot of the indicator, on the zero bar of which you need to find the maximum and minimum buffer:

 
Cmu4:

This is necessary for an EA that trades from the market. Accordingly, the values of all buffers on the current bar should be compared.

Here is a screenshot of the indicator, on the zero bar of which you need to find the maximum and minimum buffer:

It's easier then, assign in order all zero values of buffers into one array (you can even statically defined, because the number of buffers is known in advance) and apply the functions ArrayMinimum ArrayMaximum to this summary array, the result will be the serial number of the buffer in the order of assignment.
 
Urain:
Then it's simple, assign in order all null values of buffers into one array (you can even set it statically since the number of buffers is known beforehand) and apply ArrayMinimum ArrayMaximum functions to this summary array, as a result you will get the order number of buffers in order of assignment.
Thanks, it will do! :)