log in     sign up for free
 
The more disciplined you can get, the better you are going to do in the market. The more you listen to tips and rumors, the more money you're likely to lose.
David Ryan
 
 
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 Slope

Formula for: MetaStock

indicator


 

 

Views:  1713

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
The basic "programming" in MetaStock of the LRS-ROC indicator is like this: NIO is the _basic_ number of points taken to calculate the ROCs. The four ROCs _per day_ used for interpolation are:
rll:=ROC(O,nio-1,%)/(nio-1);
rl:=ROC(O,nio,%)/nio;
rh:=ROC(O,nio+1,%)/(nio+1);
rhh:=ROC(O,nio+2,%)/(nio+2);

Now, interpolation is done at a point XIO (0<=xio<=1), i.e., between the points NIO and NIO+1, using a simple interpolation formula weightingwith the _distances_ of the four ROCs from the interpolation point XIO:

rit:=(rll/(1+xio)+rl/(xio+.0001)+rh/(1-xio)+rhh/(2-xio))/(1/(1+xio)+1/(xio+.0001)+1/(1-xio)+1/(2-xio));

Then the LinearRegressionSlope is taken _twice_ (for numerical reasons) from the interpolated ROC, using the basic number of points; i.e., NIO. That is where we get our LRS-ROC indicator, named RO here:

ro:=LinRegSlope(LinRegSlope(rit,nio),nio);

NIO+XIO together represent the _real_ (not integer!) number of points ordays, the LRS-ROC indicator is calculated for, e.g. 4.57 days. Unfortunately,MetaStock is not able to use _one_ real number (e.g., 4.57) as input to be splitted into NIO and XIO and to be used in the formulas above. So NIO and XIO have to be provided separately, because of the restrictions in MetaStock, and both are subjected to some "optimization" in accordance to the historical prices.

To be clear: This LRS-ROC indicator triggers _only the timing_ for entering/closing a position, using an appropriate criterion. Additional (also ROC-based) criterions are used to stay out/in during extreme bearish/bullish situations.

Additionally: This "TA" is only one basic element of my option trading system, primarily to catch some "special reality effects" that cannot be modeledby example-based know-how recycling from historical data. But probably thisTA system may also be used as a "stand-alone" system.

Rudolf Stricker

 

 



Code:

Linear Regression Slope

nio:=Input("Number of points taken to calculate the ROCs",3,1000,14);

rll:=ROC(O,nio-1,%)/(nio-1);
rl:=ROC(O,nio,%)/nio;
rh:=ROC(O,nio+1,%)/(nio+1);
rhh:=ROC(O,nio+2,%)/(nio+2);

xio:=Input("Distances of ROCs from interpolation point XIO ",0.01,1,0.5);

rit:=(rll / (1+xio) +
rl / (xio+.0001)+
rh / (1-xio) +
rhh / (2-xio)) /
( 1 / (1+xio) + 1 / (xio+.0001) + 1 / (1-xio) + 1 / (2-xio));

ro:=LinRegSlope(LinRegSlope(rit,nio),nio);
ro


 





Source: http://www.guppytraders.com

 

View similar (indicator for MetaStock):

Cumulative Flosting Volume
Siroc IV
True Strength Index V
Day Trading Volatility Index - DTVI
Price Oscillator Wave
Market Pressure - Ultimate
STIX Oscillator
Volatility Stop by Chande & Kroll
Shifted TSMA Indicator
CandleCode II and Candle Strength Index
...
 
 
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