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

[EquisMetaStock Group] Re: Fromula to Reference a Diagonal line?



PureBytes Links

Trading Reference Links

metastockuser,

Try this:

{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)",3,700,15);
Signal:=Ref(H,-len);
Barbk:=Input("Barsback High",0,700,2);
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;
x:=Mov(C,3,S);
y:=If(line>1,x,x);
y;
{end}

When plotted this will plot the high and low horizontal line and a
slope from those points. It also will plot the "x" variable[Mov
(C,3,S)] during the same period of time.

This was originally written for a different reason but should provide 
what you want. You can bracket out {} what you don't need.

Preston



--- In equismetastock@xxxxxxxxxxxxxxx, "metastockuser" 
<metastockuser@xxxx> wrote:
> Can someone direct me to a post or a formula that would tell me how 
to
> refer to a diagonal line in code?
> 
> Since I want to work with a desending triangle and I know where the 
> diagonal line begins and ends (and the values), all I need is a way 
to
> refer to such a line in code.
> 
> I'm not really getting any hits on "diagonal" or "triangle".  I 
don't
> so much need to plot it as to refer to it.  I'm drawing the lines in
> myself.



 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
     http://groups.yahoo.com/group/equismetastock/

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