
You are missing trading opportunities:
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
Registration
Log in
You agree to website policy and terms of use
If you do not have an account, please register
That's right ... And I need the length of the Red Line... Imagine if these two parallel lines were vertical, what would the blue line show ?
It's really rubbish.
I showed the principle of automating this kind of calculation, the rest is up to you, for you are all right with your brains.
And here we hit something...
https://www.mql5.com/ru/forum/233174
That's right ... And I need the length of the Red Line... Imagine if these two parallel lines were vertical, what would the blue line show ?
It is possible that this red line will not be perpendicular due to the fact that it can be drawn only by bar price and time.
As an option, I see the following sequence: we determine the slope of the trend line or plot the trend line by an angle and obtain the perpendicular angle by which we calculate the distance to the second line.
But this is just a theory. It should be checked.
It is possible that this red line will not be perpendicular because it can only be drawn based on the bar price and time.
As an option, I see the following sequence: we determine the slope of the trend line or draw the trend line by the angle and obtain the perpendicular angle based on which we calculate the distance to the second line.
But that's just theory. It needs to be tested.
Bummer. It is time to apply Fourier transforms.
It really does suck.
I showed you the principle of automating this kind of calculation, the rest is up to you, for you are all right in the head.
Well, we've hit on something here, too.
https://www.mql5.com/ru/forum/233174
a little bit, not the same... but something similar is there )
What a puzzle...
a little, not the same ... but there's something similar.)
What a puzzle...
There's no puzzle.
Find the angle, find the cathetus using the formula.
Here's the subject:
https://www.mql5.com/ru/forum/163710All right ... And I need the length. the red line. Imagine if the two parallel lines were vertical, what would the blue line show ? (at different angles, will be different length)
If you draw two parallel lines 10 cm apart on a white sheet of paper(Fig.7), you can twist the sheet at any angle and it will still be the same 10 cm(Fig.6).
I'm confused about your goals...
Tell me what you have initially, please. It's not clear to me how you can ask about distance if we don't have parallel lines, and if we do, how is the second line constructed without that data?
Above you cited the code of the two lines, but, allow me, there is no parallelism there at all.
Or is the task just to build parallel lines? Or to check if the lines are parallel? Or just find the difference between any two lines at any time?
The example with the sheet is very simple, but the graph can show a different picture because of holes in the history, as an example - cut the sheet into three parts and remove the middle part, connect the two remaining parts and you will see that the lines have become curved, but the distance between them is preserved. Accordingly, we can measure the distance at any point where the line has not yet been cut, and for that we need coordinates at two points without holes for each line, or with holes restored.In order to solve the problem you have to:
1. draw a perpendicular to the given parallel lines
2. determine the points of intersection of the perpendicular with the given lines
3. calculate the distance between the intersection points
Clearly in pictures:
(different lines and distances between them)
.............................................................................
.............................................................................
.............................................................................
.............................................................................
Anyway, made this option - you can set delta and you can find from price/time position, provided the lines are really parallel.
In the code the x-axis sees bars, so if you need more accuracy for prediction you need to convert to seconds and check the holes.
You can only predict the price given the bars in the future - this has to be calculated separately, given the planned holes! The funny thing is that sometimes you have to create them opposite...
Anyway, made this option - you can set delta and you can find from price/time position, provided the lines are really parallel.
In the code the x-axis sees bars, so if you need more accuracy for prediction you need to convert to seconds and check the holes.
You can only predict the price given the bars in the future - this has to be calculated separately, given the planned holes! The funny thing is that sometimes you have to create them opposite...
Do I understand correctly that the delta is the blue line ... Isn't the size of the red one here ?
https://c.mql5.com/3/181/lineee__2.jpg