What should the price glass be like? - page 14

 
Roman:

Where do you get such crooked data? ))

1) Define a clear range of selecting data, for example 20 up, 20 down
and select only this range, and anything else is not important to us.

2. You say that prices come from higher to lower and they are ordered in descending order.
So what may come higher or lower, it does not matter, look not at the prices but at the indexes in the array.

2. If you mean order by distance between price levels, it doesn't matter at all, we have indexing in the receiving array.

You know, at first I thought I could do it without the loop too. And believe me, if I could, I would have done it without a loop. But the task is more complicated than it seems. Try to write your solution into code and test it on a simple tumbler table, which is easy to create with the internal library. It will be informative and interesting. And then you will see all the pitfalls.
 
Реter Konow:
You know, at first I thought I could do it without a cycle too. And believe me, if I could, I would have done it without a loop. But the problem is more complicated than it seems. Try to write your solution into code and test it on a simple tumbler table, which is easy to create with the internal library. It will be informative and interesting. And then you will see all the pitfalls.

Most likely the problem is trying to process crooked incoming data.
Would it make sense to change the source? One that will give the correct data.

 
Roman:

Most likely the problem is trying to process crooked incoming data.
Would it make sense to change the source? One that will give the correct data.

The principle of the cup is that only those data is sent to it, to which the current changes in order volumes are related. That is, the cup does not reflect the exact order of prices, it shows those prices at which there has been a recent change in volumes. Take a good look at how the MT5 slider works. Better yet, record a video and watch it frame by frame and you will understand everything.
 
Реter Konow:
The principle of the cup is that only the data to which the current changes in order volumes are related is sent to it. That is, the slider does not reflect the exact order of prices, it shows those prices at which there was a last change in volumes. Take a close look at how the МТ5 slider works. Better yet, record a video and watch it frame by frame and you will understand everything.

It reflects what arrives in the OnBookEvent() handler.
The data you send to the handler is not correct, just sign it))