log in     sign up for free
 
Combine your enthusiasm, energy, focus, devotion, and discipline to becoming the best trader you can be, but once you have done that, there is no point in agonizing over the details.
Jack D. Schwager
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time Data
 

Buy

MetaStock

     (special offer)
 
 
 

Buy

EOD data for MetaStock

     (special offer)
 
 
 

Buy

Realtime data for MetaStock

     (special offer)
 
 
 
Formula Library
 
AmiBroker
MetaTrader
MetaStock
TradeStation
Wealth-Lab
NinjaTrader
 
add your formula
System Library
 
 
Account login
Your email:
Password:
 
Log in
New to s4t? Sign up.
If you forgot your password click here.
Search the Web
 
Custom Search

Linear Regression True Slope

Formula for: MetaStock

indicator


 

 

Views:  1644

Added: July 09, 2007
 
Rate this code:  Rate: 1 Rate: 2 Rate: 3 Rate: 4 Rate: 5
This formula has not been rated yet
 

email this link

 
 
Tags: MetaStock, indicator
 
Your Ad Here
Linear Regression true slope, displays output in 0~100% or 0~90 degrees.

 

 



Code:

Linear Regression True Slope
{ Linear Regression true Slope v3.5 }
{ -100~+100% / -90~+90 degrees }
{ (c) Copyright 2003-2004 Jose Silva }
{ http://www.metastocktools.com }

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,1);
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)


 






Author: Jose Silva
Source: http://www.metastocktools.com

 

View similar (indicator for MetaStock):

Tar(SZ)an
Candle - Hammer
Smoothing Techniques
TrapAbs Indicator
Exponential Moving Average - %Price Change - Filtered
Dunnigan Trend
MACD - Tops and Bottoms
Fractal AMA (FRAMA)
RSI - Canonical
FibCMO Indicator
...
 
 
all formulas for MetaStock
all formulas

 

 

Email to friend

Top

 

     
However we try to maintain hiqhest possible level of service - most formulas, oscillators, indicators
and systems are submitted by anonymous users.
Therefore S4T™ does not take any responsibility for it's quality.
If you use any of this information, use it at your own risk. You are responsible for your own trading decisions.
Be sure to verify that any information you see on these pages is correct, and is applicable to your particular trade.
In no case will S4T™ be responsible for your trading gains or losses.
 
Privacy note | (c) copyrights systems4trading.com 2006-2012