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

 
Nikolay Ivanov #:

what, where and when and from where to where, the answer is clear.

The size of the chart in pixels is known, the number of candlesticks displayed, their dates, indents are known, max/min prices are obtained. What is the problem?

 
Vitaly Muzichenko #:

Let me be more specific

Should the line be checked for an extremum on which bar at 0 or 1 ? or which other bar ?

 
Andrey Sokolov #:

The size of the chart in pixels is known, the number of candlesticks, their dates, indents are known, max/min prices are obtained. What is the problem?

I can outline 2 problems at a glance...

1) If you have 1 pixel corresponds to 10 points (for example). How many pixels would you need to cover 15 points?

2) If the min and max of the chart is changed by scrolling, or changing the TF or changing the scale, will the requirement that the circle must correspond to a given number of points be met?

 
Nikolay Ivanov #:

I can think of two problems...

1) If you have 1 pixel corresponding to 10 points (for example)... Then how many pixels would it take to cover 15 points?

2) If min and max chart will be changed by scrolling, or changing TF or changing scale, will the requirement that the circle must correspond to a given number of points be met?

1 - Can you round to integers?

2 - It is not forbidden to recalculate according to the event on the chart

Do you have real problems or contrived ones?
 
Vitaly Muzichenko #:

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 (fracture)


So? What's wrong with the ZigZag? - It'll always show the direction of the last break.

and you will immediately get rid of the next task - to filter the breaks in a couple of points - Deviation setting


and another future task for people like your TS - find how many bars ago was the break - in my example, you can also return such a value

And one more time - my ZZ code must be made into a separate function and calculate ZZ for each line on every tick and remember for each line the last direction of ZZ and the bar number where the last calculation was - the calculation will be fast, you can run it in the tester



if you want, do as they say on the forums - if Buf[1] > Buf[2] && Buf[2] > Buf[3].... probably MA is going down....

 
Nikolay Ivanov #:

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

I may have misunderstood, but what's so difficult about setting the diameter in pips?


 
Nikolay Ivanov #:

Should the line be checked for an extremum on which bar at 0 or 1 ? or which other bar ?

At zero.

One of two low lines = Bar[1] <Bar[0], one of two high lines =Bar[1] >Bar[0]

Search along the top 2 lines and the bottom 2 lines

At any given time there could be a break on the second highest and the first lowest, or on the lowest and the highest, or on the first highest and the second lowest. Or on both at once.

 
Andrey Sokolov #:

1 - Can you round to integers?

2 - It is not forbidden to recalculate to an event on the chart.

1) It's not rounding it's an error... and a very big one... in my example it's 10, but on some instruments it could be 100, 1000, 10000, etc... nice rounding...

2) So you will tell the customer that it is possible, and then make his processor 24 by 7 check all the icons on all the charts every second to see if the circle size can change there... + He'll need to make sure your code is always on. I think it's sabotage :)

Bottom line... At first you said that the task can be solved, but then it turned out that the values will be approximate and have a large margin of error, and the watchdog code must work to fix and adjust the values by hanging the processor...

And you think this is called solving the problem? It's called grabbing without thinking, then convincing/proving/questioning that it's right...

 
Igor Makanu #:

So? What's wrong with the ZigZag? - It will always show the direction of the last fracture

and you will immediately get rid of the next task - to filter the breaks in a couple of points - Deviation setting


and another future task for people like your TS - find how many bars ago was the break - in my example, you can also return such a value

And one more time - my ZZ code must be made into a separate function and calculate ZZ for each line on every tick and remember for each line the last direction of ZZ and the bar number where the last calculation was - the calculation will be fast, you can run it in the tester


if you want, do as they say on the forums - if Buf[1] > Buf[2] && Buf[2] > Buf[3].... probably MA goes down....

Looked again, how to apply to my problem - haven't figured it out yet.

 
Vitaly Muzichenko #:

At zero.

One of the two low lines= Bar[1] <Bar[0], one of the two high lines=Bar[1] >Bar[0].

We search along the top 2 lines and the bottom 2 lines

At any given time there could be a break on the second highest and first lowest, or on the lowest and highest, or on the first highest and second lowest. Or on both at once.

1)Look for fractures on all lines.

2) From those where there is a break, we select the one with 0 bar extremum...

Does this algorithm work?

Reason: