I want to calculate the slope of a line that is Perpendicular to a known line:
Line A is Perpendicular to line B;
Slope of Line A: SlopeA = (Price1-Price2)/(bar2-bar1);
Because Line A is vertical to line B, So:
SlopeA*SlopeB = -1;
Therefore: SlopeB = - 1/SlopeA = - (bar2-bar1)/(Price1-Price2);
furthermore, the priceX on line B at bar X should be: price X = aknownpriceonlineB + SlopeB*barX
BUT, when I put this into my indicator, it will never work!
What's wrong here? Could anybody help please?
Thanks,
Jean
i don't understand this: I want to calculate the slope of a line that is Perpendicular to a known line
i don't understand this: I want to calculate the slope of a line that is Perpendicular to a known line
slope of a perpendicular is 90 degrees?
slope of a perpendicular line is infinite not zero. this is the reason.
NO, What I meant is that two lines, one is perpendicular to the other, in another word, the angle between this two lines is 90 degree.
IMHO it is a monkey business. Each monitor performs another angle. So search for proportions between pips and time of bars.
This is NOT for view on the screen, this is for calculation in an indicator.
consider use of very good search box at top right all site pages.
you will [if patient] end up with results containing some very enlightened comments related to this area.
enjoy
I want to calculate the slope of a line that is Perpendicular to a known line:
Line A is Perpendicular to line B;
Slope of Line A: SlopeA = (Price1-Price2)/(bar2-bar1);
Because Line A is vertical to line B, So:
SlopeA*SlopeB = -1;
Therefore: SlopeB = - 1/SlopeA = - (bar2-bar1)/(Price1-Price2);
furthermore, the priceX on line B at bar X should be: price X = aknownpriceonlineB + SlopeB*barX
BUT, when I put this into my indicator, it will never work!
What's wrong here? Could anybody help please?
Thanks,
Jean
Jean,
I think your problem is in the calculation of the original slope. It should be SlopeA=(y1-y2)/(x1-x2) -----> SlopeA=(Price1-Price2)/(bar1-bar2). I presume that you are using the time of each bar to calculate?
So, the slope of the perpendicular line would be SlopeB = - (1/SlopeA) = - (bar1-bar2)/(Price1-Price2)
And thus, the equation for (Bar,Price) on the perpendicular line through the point (KnownBar,KnownPrice) is: y = m (x - a) + b ==> Price = SlopeB * (Bar - KnownBar) + KnownPrice
Hope this helps.
- Tovan
Jean,
I think your problem is in the calculation of the original slope. It should be SlopeA=(y1-y2)/(x1-x2) -----> SlopeA=(Price1-Price2)/(bar1-bar2). I presume that you are using the time of each bar to calculate?
So, the slope of the perpendicular line would be SlopeB = - (1/SlopeA) = - (bar1-bar2)/(Price1-Price2)
And thus, the equation for (Bar,Price) on the perpendicular line through the point (KnownBar,KnownPrice) is: y = m (x - a) + b ==> Price = SlopeB * (Bar - KnownBar) + KnownPrice
Hope this helps.
- Tovan
Yes, thank you for given in detail.
Jean
Jean,
I think your problem is in the calculation of the original slope. It should be SlopeA=(y1-y2)/(x1-x2) -----> SlopeA=(Price1-Price2)/(bar1-bar2). I presume that you are using the time of each bar to calculate?
So, the slope of the perpendicular line would be SlopeB = - (1/SlopeA) = - (bar1-bar2)/(Price1-Price2)
And thus, the equation for (Bar,Price) on the perpendicular line through the point (KnownBar,KnownPrice) is: y = m (x - a) + b ==> Price = SlopeB * (Bar - KnownBar) + KnownPrice
Hope this helps.
- Tovan
I figured out that in order for the condition SlopeB = - (1/SlopeA) become true, we need to put a conversion factor for the price. For the x-axis we use the number of bars, for the y-axis we use price, BUT, we have to define the unit of price, only when price/bar = 1, then we are in proportion, only in this condition we can calculate angle between two lines, so, the introduction of a conversion facotr is necessary, so, the operation should be: IF SlopeB = - (1/SlopeA) = - (bar1-bar2)/(Price1-Price2)*conversionfactor; THEN Price = SlopeB * (Bar - KnownBar) + KnownPrice will be TRUE, How to calculate or accomplish this?
HELP please!
Jean
- Free trading apps
- Over 8,000 signals for copying
- Economic news for exploring financial markets
You agree to website policy and terms of use
I want to calculate the slope of a line that is Perpendicular to a known line:
Line A is Perpendicular to line B;
Slope of Line A: SlopeA = (Price1-Price2)/(bar2-bar1);
Because Line A is vertical to line B, So:
SlopeA*SlopeB = -1;
Therefore: SlopeB = - 1/SlopeA = - (bar2-bar1)/(Price1-Price2);
furthermore, the priceX on line B at bar X should be: price X = aknownpriceonlineB + SlopeB*barX
BUT, when I put this into my indicator, it will never work!
What's wrong here? Could anybody help please?
Thanks,
Jean