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

[EquisMetaStock Group] Re: Trace a line



PureBytes Links

Trading Reference Links

Roy had posted a method to "terminate" the plotting of a trendline.
I will post just the relevant code.
Please use it to suit your need. This code plots the ROC and a 
trendline on the ROC.
==================================
{Line Plot on ROC}
D:=Input("Line Length",48,52,50);
F:=Input("Roc Periods",5,99,20);
A:=ROC(C,F,%);
B:=BarsSince(A=Highest(A));
D1:=Cum(1)=LastValue(Cum(1))-LastValue(B);
{D1 is first bar of line}
D2:=Cum(1)=LastValue(Cum(1))-LastValue(B)+D;
{D2 is last bar of line}
P1:=A; {start-of-line data array}
P2:=A; {end-of-line data array}
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));
{THIS PORTION IS WHAT YOU'RE LOOKING FOR}
Line:=Ref(Ref(Line,-Bp),Bp); {blank end of line}
A; {Rate of Change}
Line;
========================
And don't thank me, thank Roy. :-)
Dusant

--- In equismetastock@xxxxxxxxxxxxxxx, "Scoubidoo \(Alain\)" 
<scoubidoo@xxxx> wrote:
> Hi, 
>  
> I'd like to trace a line between 2 tops.
>  
> Those tops are from  "high -20 days before"  to  " high-8 days 
before".
>  
> I only know a formula to trace a line until yesterday's high. But 
i'd
> like to stop the line, many days before, yesterday's high.
>  
> How should I construct the formula ?
>  
> Regards,
>  
> Scoubidoo.


------------------------ 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/