Any questions from newcomers on MQL4 and MQL5, help and discussion on algorithms and codes - page 1758

 
Vitaly Muzichenko #:

Q: As far as we know, one problem has several solutions


We have 8 buffer lines, from them we need to find the 2 highest and the two lowest

The condition of searching:

On one of the two highest and two lowest lines there should be a break, signal: low= Bar[1] < Bar[0], high=Bar[1] >Bar[0]

What is the best way to implement it in code?

This is a somewhat complicated task you've formalized, or rather you don't know what to do ))))

as far as I understand, for each indicator buffer it is easier to calculate the ZigZag - and look in which direction the last break of ZZ will be directed

and which line's tail is lower/higher than others by simple double comparison


the ZigZag for a dozen lines was posted herehttps://www.mql5.com/ru/forum/318267#comment_12508440

it does not redraw, and in fact you only need to know the UP flag in my example, i.e. it is enough to make my WP indicator as a function to pass the number of the last calculated bar and the UP flag - imho, it will all work very fast

 
Nikolay Ivanov #:

it can't be solved...

It can't for you. You don't have to say that for everyone; you certainly don't have to say it for me.

 
Andrey Sokolov #:

For you, it can't. You don't have to say that for everyone, and you certainly don't have to say it for me.

OK, show me your code where the icon is placed with an adjustable size in points.

 
Nikolay Ivanov #:

OK, show me your code where the icon is placed with adjustable size in points.

I'll do it if necessary.

 
Andrey Sokolov #:

For you, it can't. And you don't have to claim such a thing for everyone, you certainly don't for me.

It's easy to make an X*U circle because it doesn't depend on the scale of the graph,

but to make a circle of X*Y you have to adjust the scale of the graph otherwise it's an Elipse.

 
Andrey Sokolov #:

I'll do it if I have to.

That's what I thought... and why you had to make such a big fuss... I don't know... first do it (without cheating and substituting concepts) and then say you can do it...

 
MakarFX #:

To make a circle Point*Period, you have to adjust the scale of the graph, otherwise it's an Elipse.

Nope, no one said anything about fitting... the diameter of the circle must always be equal to a given number of points.

 
Nikolay Ivanov #:

That's what I thought... why bother with the bullshit... I don't know... first do it (without cheating and substituting concepts) and then say you can do it...

Calculate where and what is possible, and there's no time to prove anything to you personally.

 
Igor Makanu #:

You have formalized the problem in a complicated way, or rather you do not know what to do ))))

as far as I understand, for each indicator buffer it is easier to calculate the ZigZag - and look in which direction the last break of ZZ will be directed

and which line's tail is lower/higher than others by simple double comparison

the ZigZag for a dozen lines was posted herehttps://www.mql5.com/ru/forum/318267#comment_12508440

it does not redraw, and in fact you only need to know the UP flag in my example, i.e. it is enough to make my WP indicator as a function to pass the number of last calculated bar and the UP flag - imho, it will work very fast

I will try to be more specific

Current moment: We see 2 lines at the top and 2 at the bottom

One of the upper gave a signal and one of the lower gave a signal - the second one from the bottom (break)


 
Andrey Sokolov #:

You can calculate where and what, but there is no time to prove anything to you personally.

"what" and "where" and "when" and "from" and "somewhere" - the answer is clear...