Calculate the distance between two parallel lines including ! - page 8

 
Itum:
It seems simple ... but it doesn't get the result you want
Did you apply the angle in degrees or radians?
 

You don't need an angle.

you have to determine the parameter a

it's quite simple.


for example

any line is plotted on the basis of two points whose coordinates are known


.

Time is measured in bars of the current time frame taking into account the bars countdown.

The first reading is considered to be zero. Then the second reading equals 18-13=5 (in this case)

From the equation

r2 = r1 + 5*a

determine

a = (r2 - r1)/5

That's all.

 
Олег avtomat:

You don't need an angle.

you have to determine the parameter a

it's quite simple.


for example

any line is constructed from two points whose coordinates are known


.

Time is measured in bars of the current timeframe with counting of bars backwards.

The first readout is equal to zero; in this case, the second readout equals 18-13=5 (in this case)

From the equation

r2 = r1 + 5*a

determine

a = (r2 - r1)/5

That's all.

what is a?
 
Renat Akhtyamov:
what is a?

Oleg avtomat2018.03.31 04:30

 
Renat Akhtyamov:
what is a?

This is the slope factor. I posted the code earlier, it's almost all there, in terms of working with the function, but there's no perpendicular - in fact it just needs to be completed, maybe I'll do it a bit later, if someone doesn't write another one.

 

Suggested a variant to the author of the topic.

If the author allows it, I'll show you the code.


 
Dmytro Zelenskyy:

Suggested a variant to the author of the topic.

If the author allows it, I'll show you the code.


Did you move the lines like this?

If so, does it work? Just that the author has been offered more than one variant and none of them suits him...

 
Sergey Kolemanov:

Did you move the lines like this?

If so, does it work? The author has been offered many variants, and none of them suits him...

It shows conditional 0.01541, which does not depend on scale and TF


 
Dmytro Zelenskyy:

Shows a conditional 0.01541, which is independent of scale and TF


Well yes, if I understand it correctly). It remains to hear from the author of the topic.

 
The best solution would probably be to draw your own coordinate system