Welcome Guest, please sign in to participate in a discussion. Search | Active Topics |

Regression Lines Rate this Topic:
Previous Topic · Next Topic Watch this topic · Print this topic ·
quadrun
Posted : Saturday, December 4, 2004 9:40:37 AM
Registered User
Joined: 11/29/2004
Posts: 8
I noticed that TC2000 now has regression lines that can be added to indicators. Is there any way this function can be added for a scan? To facilitate adding this to indicators, I assume it is a called function now like say RGRSC50 for a regression line covering 50 daily closing prices, where RGRS is the base function and the meat of the problem. I can manually enter a regression line, but the work is multitudinous to say the least, and the real problem is if I want to check various time frames based on a group of stocks beta, etc, I have to retype a whole new function. This would be a very beneficial function for quickly determining the overall trend of a stock on some period of time.

Thanks for your input.
Craig_S
Posted : Saturday, December 4, 2004 10:28:00 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
quadrun,

The PCF formula language does not have syntax for Linnear Regression lines. You can use the Visual Sorting to find stocks with particular regression patterns. Take a peek at this video and see if it gives you some ideas:

http://www.worden.com/training/default.aspx?g=posts&t=37

- Craig
Here to Help!
quadrun
Posted : Saturday, December 4, 2004 10:40:44 AM
Registered User
Joined: 11/29/2004
Posts: 8
Thanks Craig. I had the feeling it didn't. I can massage the data by writing each indicator function seperately and applying a large scaling constant to the result that allows the range/value selector to function for negative regression lines as well. Thanks for the help.
Craig_S
Posted : Saturday, December 4, 2004 10:45:08 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
Did you get a chance to watch the video? Finding positive and negative regression lines is very simple when you use the visual slope sort. I really think it will do what you want it to. It can be done on any regression line applied to any indicator!

- Craig
Here to Help!
quadrun
Posted : Saturday, December 4, 2004 11:26:37 AM
Registered User
Joined: 11/29/2004
Posts: 8
Yes, I think I have seen that video. I have also played with the visual sort box. But the problem as I see it is that I have to have a watchlist of items that I can visually sort, as opposed to a scan that returns items meeting the regression criteria I want for viewing. I have the problem in hand now. At first I overly complicated matters by writing functions that relied on conditional operators. I removed the conditional operators and applied large scaling factors that allow me to use the slider range function in the Easy Scan directly. Then I can view the results with regression lines on screen. This approach also makes it much easier to write functions for different time frames as well. Only a handful would be required. I'm assembling it now. Thanks for the help and suggestions.
murty
Posted : Tuesday, December 7, 2004 9:08:07 AM
Registered User
Joined: 10/15/2004
Posts: 11
When will you choose Lin Reg 50 and why with SD of 1.5 ? Is it related to the regression period ?
Craig_S
Posted : Tuesday, December 7, 2004 9:14:22 AM


Worden Trainer

Joined: 10/1/2004
Posts: 18,819
I cannot speak for quadrun (hopefully he will answer your question). I do know that, statistically, most samples of numbers from nature, studies, science, sports, etc. tend to stay within 1.5 to 2 standard deviations of themselves. Often numbers outside of this SD are seen as unique.

- Craig
Here to Help!
quadrun
Posted : Tuesday, December 7, 2004 11:08:37 AM
Registered User
Joined: 11/29/2004
Posts: 8
murty,

I only chose 50 day to try to catch a fairly new divergence between say price and MACD. I'm not sure I ever mentioned standard deviation. I don't really believe that bell curve type statistics can be accurately applied to stock prices, but I also don't believe in random walk theory either.

I can write functions to test for this, but I still get an awful lot of garbage hits for some reason. If TC2000 allowed you to select a regression model for scanning like they allow for charting, the program would be very very powerful. Then you could set slope limits on the indicators and sort for divergence visually. The only thing better would be testing for higher lows versus lower lows or lower highs versus higher highs between price and indicators.
Tanstaafl
Posted : Tuesday, December 7, 2004 11:15:08 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
It's quite feasible to model LinReg lines in a PCF. You can calc the slope of the line, or the value of any point on the line, with a bounded series. Any native-PCF function such as RSI or MS, etc can easily be incorporated ... it is also possible to do them for some "messier" app's such as true MACD's and Histo's.

Jim Dean
aka "Sir" Tanstaafl on TCNet

Tanstaafl
Posted : Saturday, December 11, 2004 9:33:16 AM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
I provided a bit more explanation and a small example of how to calc the LinReg slope direction at the following URL:
http://www.worden.com/training/default.aspx?g=posts&t=635

This is sufficient for writing PCF's to identify divergences. It's also possible to create PCF's that calculate the TRUE LinReg slope, and to calculate the actual VALUE of points on the LinReg line (even points in the future). The math is considerably more complex for those, however.



Tanstaafl
Posted : Monday, December 13, 2004 8:37:01 PM
Registered User
Joined: 10/7/2004
Posts: 799
Location: Duluth, GA
Oops that URL does not point to the right place anymore. Here is one for a much more comprehensive discussion of the Linear Regression Divergence. Sorry about the confusion!

http://www.worden.com/training/default.aspx?g=posts&t=755

Users browsing this topic
Guest-1

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.