# How to draw a line parallel to another line ,without using channel ?

4703

HI;

in picture below:

we have: A_PRICE , A_TIME , B_PRICE , B_TIME , C_PRICE , C_TIME

line AB is drawn , i want to draw a line parallel to it from point C , ( without using channel ).

----------------------------------------------------------------

WITH USING : ( Y-Yo ) =[ ( Y1-Yo )/ ( X1-Xo )]*(X -Xo) , equation of a line in plane passed from (Xo,Yo )  & " y=mx+b " , m=[ ( Y1-Yo )/ ( X1-Xo )]

`BAR_AB=Bars( Symbol(),Period(),A_TIME,B_TIME);`

can do this ?

```SLOPE=( B_PRICE-A_PRICE )/BAR_AB;
D_TIME=C_TIME+BAR_AB;
D_PRICE=C_PRICE+SLOPE*BAR_AB;```

AND DRAW LINE CD. ( i try that and there is problem ).

if not , how can do this ?

Moderator
18058

TIMisthebest:

can do this ?

```SLOPE=( B_PRICE-A_PRICE )/BAR_AB;
D_TIME=C_TIME+BAR_AB;
D_PRICE=C_PRICE+SLOPE*BAR_AB;```

AND DRAW LINE CD. ( i try that and there is problem ).

It should work as long as bar D is not in the future,  if it is scale the values to get a bar that is already on the chart.
4703

RaptorUK:
It should work as long as bar D is not in the future,  if it is scale the values to get a bar that is already on the chart.

and i was tried that also:

```SLOPE=( B_PRICE-A_PRICE )/BAR_AB;
D_TIME=C_TIME-BAR_AB;
D_PRICE=C_PRICE-SLOPE*BAR_AB;```

but there was problem in result. ( there is no error or warning).

=================================================

FOR EXAMPLE, as you see in pic. below :

and the points are: ( the points are Schematic )

```    BAR_AC=Bars( Symbol(),Period(),HP_A_TIME,HP_C_TIME);
SLOPE=( HP_C-HP_A )/BAR_AC;
SWEET_ZONE_POINT_TIME=HP_B_TIME-BAR_AC;
SWEET_ZONE_POINT=HP_B-SLOPE*BAR_AC;```

the result is not good and, line draw form 1 candle before point B.

is that refer to high lighted ? ( you can see the value ).

4703

OHHHHHHHHH;

MY MISTAKE :

`SWEET_ZONE_POINT_TIME=HP_B_TIME-(HP_C_TIME-HP_A_TIME);`

AND PROBLEM SOLVED;

THANK YOU.

Moderator
18058

TIMisthebest:

OHHHHHHHHH;

MY MISTAKE :

AND PROBLEM SOLVED;

THANK YOU.

Well done :-)