PureBytes Links
Trading Reference Links
|
If I understand the problem correctly, it can be stated like this:
Suppose the original trend line is defined by two points P1=(x1,y1) and
P2=(x2,y2). Given a third point P3=(x3,y3) which is not on the first trend
line, we look for a fourth point P4 such that the line P3->P4 is parallel to
the line P1->P2.
Solution: P4 = (x3+x2-x1, y3+y2-y1)
Of course, there are infinitely many other possible points P4, but the above
choice is probably the easiest.
Regards,
Michael Suesserott
-----Ursprüngliche Nachricht-----
Von: john hamon [mailto:jhamon@xxxxxxxxxxx]
Gesendet: Thursday, January 04, 2001 19:01
An: fritz@xxxxxxxx
Cc: omega-list@xxxxxxxxxx
Betreff: RE: back to the well again... parallel trend lines
gary,
thanks for the response.
problem is... how do you specify the angle of the trendline? i see no way
documented in my "exhaustive" easy language reference.
thanks for the prompt reply.
jh
-----Original Message-----
From: Gary Fritz [mailto:fritz@xxxxxxxx]
Sent: Thursday, January 04, 2001 9:57 AM
To: jhamon@xxxxxxxxxxx
Cc: omega-list@xxxxxxxxxx
Subject: Re: back to the well again... parallel trend lines
> please note that i don't want to connect two known points. i want
> to draw a parallel line through a known trend line or pair of
> points.
If you know two points, it should be pretty easy. If your points are
X1,Y1 and X2,Y2, then why not draw a line from X1+Z,Y1 to X2+Z,Y2?
That draws the trendline Z units vertically above the existing line.
If you want the parallel line to be a specific distance away from the
trendline, say H (for Hypotenuse :-), then you just need to do a
little trig.
The angle of the trendline is
theta = arctangent((Y2-Y1)/(X2-X1)).
Theta is also the angle between a vertical line and a line
perpendicular to your trendline. So
Z = H * cosine(theta)
This is off the top of my head but I think it's right...
(View this in a fixed-pitch font like Courier:)
. X2+Z,Y2
.
.
.
.
.
. | . X2,Y2
. \ | .
. \ | Z .
X1+Z,Y1 H \ | .
\| .
.
.
. theta
X1,Y1 . ----------------
Gary
|