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

[EquisMetaStock Group] Re: Slope in degrees



PureBytes Links

Trading Reference Links

Plot a 45-degree line on any chart.  Now change the date or price 
scale.  The angle or slope of that line has now visibly changed.

Without a true reference, you can only synthesize angular values in 
charts.  Here is an example:


============================
Linear Regression true slope
============================
---8<---------------------------

{ Linear Regression "true" Slope v3.5 }
{ -100~+100% / -90~+90 degrees }
{ ©Copyright 2003-2004 Jose Silva }
{ http://users.bigpond.com/prominex/pegasus.htm  }

pds:=
 Input("Linear Regression periods",2,2520,21);
pds1:=
 Input("Lin Reg Signal periods",1,252,5);
x:=Input("Open=1, High=2, Low=3, Close=4, Volume=5, P=6",1,6,4);
display:=Input("display  -100~100%=1,  -90~90 degrees=2",1,2,2);
hist:=Input("display positive histogram fill (on=1, off=0)",0,1,1);
plot:=Input("[1] LinReg Slope,  [2] signals",
 1,2,1);

x:=If(x=1,O,If(x=2,H,If(x=3,L,
 If(x=5,V,If(x=6,P,C)))));
LRlast:=LinearReg(x,pds);
LRS:=LinRegSlope(x,pds);
LRprev:=LRlast-LRS;
{LRstart:=Ref(LRlast-LRS*(pds-1),pds-1);}

a:=Min(LRlast,LRprev)/Max(LRlast,LRprev);
LRratio:=(If(LRlast>LRprev,2-a,a)-1)*80;
LRSdeg:=If(LRratio<0,Atan(LRratio,1)-360,
 Atan(LRratio,1));
LRSper:=LRSdeg*10/9;
LRStrue:=If(display=2,LRSdeg,LRSper);
signal:=Mov(LRStrue,pds1,E);
BuySell:=
 Cross(LRStrue,signal)-Cross(signal,LRStrue);
odd:=Cum(1)/2=Int(Cum(1)/2);
odd:=If(hist=1 AND LRStrue>signal,
 If(odd,signal,LRStrue),LRStrue);

If(plot=1,odd,0);
If(plot=1,signal,0);
If(plot=1,LRStrue,BuySell)

---8<---------------------------


jose '-)



--- In equismetastock@xxxxxxxxxxxxxxx, "nivelles2002be" <bs113282@xxxx
> wrote:
> Hello everybody, I would have the slope of a line in DEGREES (and 
> not in "radians");
> I know that the slope of a line is the " arc tangent" of the angle.
> How can I obtain the value of the angle in DEGREES when I have the 
> value of the slope of a line.
> ex : linregslope(C,30) is 0.023 ; what is the value of the angle in 
> degrees , and all of this in MTSK language..........
> maybe can we use tangent and "arc tangent" ?
> Thanks in advance



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
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/