PureBytes Links
Trading Reference Links
|
Scoub,Roy,
Here it is! That was fun...
Preston
{BarBack Z}
{Will draw a line from one High to the next---back in time}
{Reference highs are also displayed within the window}
len:=Input("Periods for Ref High(Set > Barsback)",8,100,20);
Signal:=Ref(H,-len);
Barbk:=Input("Barsback High",1,100,8);
Signal2:=Ref(H,-Barbk);
LastBar:=Cum(1)=LastValue(Cum(1)-(len));
bacdis1:=ValueWhen(1,LastBar,LastValue(Signal));
1stRefPnt:=Ref(Ref(bacdis1,-Barbk),Barbk);
{end}
bacdis2:=ValueWhen(1,LastBar,LastValue(Signal2));
2ndRefPnt:=Ref(Ref(bacdis2,-Barbk),Barbk);
{end}
{Line Plot }
D1:=LastValue(Cum(1))-LastValue(LEN);
{D1 is first high of line}
D2:=LastValue(Cum(1))-LastValue(BARBK);
{D2 is last high of line}
P1:=1stRefPnt; {start-of-line data array}
P2:=2ndRefPnt; {end-of-line data array}
V1:=ValueWhen(1,D1,P1);
V2:=ValueWhen(1,D2,P2);
B1:=LastValue(Cum(1))-D1;
B2:=LastValue(Cum(1))-D2;
LINE:=V1-(BarsSince(Cum(1)=D1)*( (V1-V2)/(B1-B2)));
LINE;
1stRefPnt;
2ndRefPnt;
--- In equismetastock@xxxxxxxxxxxxxxx, pumrysh <no_reply@xxxx> wrote:
> Roy,
>
> Thanks! Looking at the output of V1 and V2, I can see there is a
> calculation problem. Let me see if I can figure it out.
>
> Preston
>
>
>
> --- In equismetastock@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx>
> wrote:
> > Preston
> >
> > > Here's scoub's original request:
> > >
> > > Those tops are from "high -20 days before" to " high-8 days
> before".
> > >
> > > I read it as 8 days ago going back to 20 days ago which would
be
> 12
> > > bars. Am I wrong?
> >
> > My mistake. Your lines are ending up negative on my test chart.
> With my
> > market opening in 90 minutes it will be some time before I can
look
> more
> > closely at your code. I'm sure if you think through the mechanics
> of drawing
> > a straight line you'll spot the problem before I can get to it.
> >
> > Determine price and relative bar of the start of the line
> > Determine price and bar of the end of the line.
> > Divide the difference between two prices by the number of bars
> between them
> > to get the bar on bar increment/decrement. Easy to get this one
bar
> wrong.
> > Determine bars to truncate by counting from end of line to end of
> chart.
> >
> > Roy
------------------------ 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/
|