|
|||||||||||||||||||
|
|||||||||||||||||||
| Special offer: buy AmiBroker and EOD+Real-Time Data |
|
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:
all formulas for TradeStation all formulas
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| 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. |
|
|