log in     sign up for free
 
I like the Japanese philosophy where you ask questions rather than look for answers. The more questions you come up with the better. The answers will happen.
Sunny Harris
 
 
Home
systems (284)
 
Special offer: buy AmiBroker and EOD+Real-Time Data
 
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

R - Squared

Formula for: TradeStation

indicator


 

 

Views:  1627

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

email this link

 
 
Tags: TradeStation, indicator
 
Your Ad Here
To create the r- squared indicator described in "Standard error bands" by Jon Andersen in the September 1996 STOCKS & COMMODITIES, you must first create the coeffR function. This function must be saved and verified before you can create the r- squared indicator. The coeffR function is used to calculate the correlation coefficient r.


Type: User Function, Name: coeffRx

Inputs: Length(Numeric);
Vars: X(0), UpEQ(0), LowEQ1(0), LowEQ2(0), LowEQT(0);

X = BarNumber;
UpEQ = Summation(X * Close, Length) -
(Length * Average(X, Length) * Average(Close, Length));
LowEQ1 = Summation(Square(X), Length) -
(Length * Square(Average(X, Length)));
LowEQ2 = Summation(Square(Close), Length) -
(Length *Square(Average(Close, Length)));
LowEQT = SquareRoot(LowEQ1 * LowEQ2);

IF LowEQT <> 0 Then
CoeffRx = UpEQ / LowEQT;




Once you have created and verified the coeffR function, you can then create the r- squared indicator using the following code in the Power Editor.



Type: Indicator, Name: R - Squared

Inputs: Length(21), AvgLen(3);
Vars: R(0), SquareRx(0), AvgSqrR(0);

R = coeffR(Length);
SquareRx = Square(R);
AvgSqrR = Average(SquareRx, AvgLen);

Plot1(AvgSqrR, "AvgSqrR");
Plot2(1, "Upper");
Plot3(0, "Lower");






This code is available at both the Omega Research Forum on America Online as well as at Omega's Web site.
-- Gaston Sanchez, Omega Research
800 422-8587, 305 270-1095
Internet: http://www/omegaresearch.com

 

 



Code:



Type: User Function, Name: coeffRx

Inputs: Length(Numeric);
Vars: X(0), UpEQ(0), LowEQ1(0), LowEQ2(0), LowEQT(0);

X = BarNumber;
UpEQ = Summation(X * Close, Length) -
(Length * Average(X, Length) * Average(Close, Length));
LowEQ1 = Summation(Square(X), Length) -
(Length * Square(Average(X, Length)));
LowEQ2 = Summation(Square(Close), Length) -
(Length *Square(Average(Close, Length)));
LowEQT = SquareRoot(LowEQ1 * LowEQ2);

IF LowEQT <> 0 Then
CoeffRx = UpEQ / LowEQT;






Type: Indicator, Name: R - Squared

Inputs: Length(21), AvgLen(3);
Vars: R(0), SquareRx(0), AvgSqrR(0);

R = coeffR(Length);
SquareRx = Square(R);
AvgSqrR = Average(SquareRx, AvgLen);

Plot1(AvgSqrR, "AvgSqrR");
Plot2(1, "Upper");
Plot3(0, "Lower");





 






Author: Jon Andersen
Source: http://www.traders.com

 

View similar (indicator for TradeStation):

Stochastic S&C Indicator
eVwma
VIDYA/CDMA
Finite Volume Element (FVE)
Recursive Moving Trendline Indicator
RSI of Volatility
SMI_TRADE Indicator (Stochastic Momentum Index Trade)
Moving Average of Volume
MACD (DEMA)
TFS Indicators
...
 
 
all formulas for TradeStation
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