[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] Trace a line



PureBytes Links

Trading Reference Links

Hi Preston

I have three line versions in MS. At least one of these is Jose's and the
other two have had some input from him. I trust you can extract some ideas
from one of these formulas.

Roy

  {RL Draw Line}
D1:= DayOfMonth()=3 AND Month()=10 AND Year()=2001; {example}
D2:= DayOfMonth()=22 AND Month()=10 AND Year()=2001;
P1:=C; {beginning price formula}
P2:=C; {ending price formula}
V1:=ValueWhen(1,D1,P1);
V2:=LastValue(ValueWhen(1,D2,P2));
B1:=LastValue(BarsSince(D1));
B2:=LastValue(BarsSince(D2));
Bp:=LastValue(B2);
Line:=V1-Cum(If(D1=0,(V1-V2)/(B1-B2),0));
Line:=Ref(Ref(Line,-Bp),Bp); {blank end of line}
Line;

{Draw Line Version 1.1}
Date1:= DayOfMonth()=3 AND Month()=10 AND Year()=2001;
Date2:= DayOfMonth()=22 AND Month()=10 AND Year()=2001;
Date3:= DayOfMonth()=22 AND Month()=10 AND Year()=2001;
P1:=C; {beginning price formula}
P2:=C; {ending price formula}
P3:=H; {ending price formula second line}
V1:=ValueWhen(1,Date1,P1);
V2:=LastValue(ValueWhen(1,Date2,P2));
V3:=LastValue(ValueWhen(1,Date3,P3));
B1:=LastValue(BarsSince(Date1));
B2:=LastValue(BarsSince(Date2));
B3:=LastValue(BarsSince(Date3));
Bp:=LastValue(B2);
Bp1:=LastValue(B3);
Line1:=V1-Cum(If(Date1=0,(V1-V2)/(B1-B2),0));
Line1:=Ref(Ref(Line1,-Bp),Bp);
Line2:=V1-Cum(If(Date1=0,(V1-V3)/(B1-B3),0));
Line2:=Ref(Ref(Line2,-Bp),Bp);
Line1; Line2;


  {JS Draw Lines}
  {define events}
time1:= DayOfMonth()=1 AND Month()=3 AND Year()=2001;
time2:= DayOfMonth()=26 AND Month()=2 AND Year()=2002;
price1:=C;
price2:=C;
  {restrict to last events}
time1:=time1 AND Cum(time1)=LastValue(Cum(time1));
time2:=time2 AND Cum(time2)=LastValue(Cum(time2));
  {sort events}
e1pds:=LastValue(BarsSince(time1));
e2pds:=LastValue(BarsSince(time2));
x1:=If(e1pds>e2pds,time1,time2);
x2:=If(e1pds>e2pds,time2,time1);
y1:=If(e1pds>e2pds,price1,price2);
y2:=If(e1pds>e2pds,price2,price1);
  {fix coordinates}
y1:=ValueWhen(1,x1,y1);
y2:=LastValue(ValueWhen(1,x2,y2));
b1:=LastValue(BarsSince(x1));
b2:=LastValue(BarsSince(x2));
plot:=y1+BarsSince(x1)*(y2-y1)/(b1-b2);
plot:=Ref(Ref(plot,-b2),b2);
plot;


> Roy & Scoub,
>
> Starting playing around with several of the formulas that Roy has
> posted. What I have initially come up with is a horizontal view of
> the high 20 bars ago that is constant for the next 12 bars. Meaning
> that the display extends from 20 bars ago to 8 bars ago and is
> constant.
>
> Since the original question was for a line from one high to the next
> I am assuming it would be an declining trendline. To do this we
> incorporate the slope and subtract its value from the line each day
> forward. This is where I'm stumped. Any suggestions?
>
> {BarBack View}
> len:=Input("Periods for Ref High",1,100,20)-1;
> Signal:=Ref(H,-len);
> Barbk:=Input("Barsback High",1,100,8)-1;
> Signal2:=Ref(H,-Barbk);
> Slope:=(Signal-Signal2)/(len-Barbk);
> Periods:=len; {periods to display last value}
> LastBar:=Cum(1)=LastValue(Cum(1)-(Periods));
> bacdis:=ValueWhen(1,LastBar,LastValue(Signal));
> {blank right side of line}
> Line:=Ref(Ref(bacdis,-Barbk),Barbk);
> line{end}
>
>
> Preston
>
>
>
> To unsubscribe from this group, send an email to:
> equismetastock-unsubscribe@xxxxxxxxxxxxxxx
>
>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>



------------------------ Yahoo! Groups Sponsor ---------------------~-->
Buy Ink Cartridges or Refill Kits for Your HP, Epson, Canon or Lexmark
Printer at Myinks.com. Free s/h on orders $50 or more to the US & Canada. http://www.c1tracking.com/l.asp?cid=5511
http://us.click.yahoo.com/l.m7sD/LIdGAA/qnsNAA/BefplB/TM
---------------------------------------------------------------------~->

To unsubscribe from this group, send an email to:
equismetastock-unsubscribe@xxxxxxxxxxxxxxx

 

Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/