How do you calculate the length of a line from the coordinates? - page 11

 
Mischek:

I think Integer is the only option if you need a number.
You're not in trading, are you?
 
gip:

It doesn't seem like a difficult question.

As it turns out - complicated :) For perception.
 
gip:

Ten pages already. It doesn't seem like a difficult question.

Pixels are a good way to measure it.


What's so great about it? I have stretched the price chart window - its length in pixels has changed. Changed the timeframe - the same.
 
api:

And what good would that do? I have expanded the price chart window - its length in pixels has changed. And if you change timeframe, the time frame has also changed.

It is clear to everybody. But apparently, it works for the customer.

--

You were sent to see a spider, why not go? Not a solution, of course, but it would add a little insight.

 
api:

What good is that? I have stretched the price chart window - the length in pixels has changed. Changed the timeframe - same thing.

It is necessary for relative percentage comparison. You can stretch and shrink as much as you want - everything is cool.
 
AlexSTAL:

Needed for a relative percentage comparison. You can stretch and shrink as much as you like, all tic-tac-toe

But what to do if the line ends are outside the window and are not visible - therefore have no graphic coordinates of the pixel, and the pixel itself does not exist?
 
api:

But what if the line ends are outside the window and are not visible - therefore have no graphic coordinates of the pixel, and no pixel itself?

You misunderstand. We are converting to a single unit of measurement through the scale of a square pixel. We don't work with the screen and its pixels at all. Take a look at the function.
 
AlexSTAL:

You don't get it. We are converting to a single unit of measurement through the scale of a square pixel. We don't work with the screen and its pixels at all. Look at the function.


Yes, I have already looked at it and understood it.

If it's about comparing at the same moment, then yes - it works. If that's all it takes, then problem - solved.

 
AlexSTAL:

I forgot to post the adapted code, maybe someone will need it

B1 and B2 are bar numbers

The code is not correct.

.

Because you can have indicator windows on the chart - this is one

(in this case, the height of the price window is unknown - and we get the total height) .

.

Secondly, it has exactly the error I was talking about -

when scrolling the chart left and right, the coefficients change.

to convert the price into pixels.

 
Mischek:
The Integer option is the only one, if you need a number.
I'll join the Integer fans in specifying the api . If you get a stable result, then you can judge something by it and dance around it.