Showing posts with label linear regression slope. Show all posts
Showing posts with label linear regression slope. Show all posts

Sunday, May 20, 2007

Testing - Composite Cross Over

Many times I like to add some complexity to my simpler filters to see what would happen if...

Today I was looking at the cross over filter v6. That looks like this -
show stocks where close is between 15 and 35
and average volume(90) > 500000
and open < ema(21)
and open < ema(8)
and open < ema(4)
and close > ema(21)
and close > ema(4)
and close > ema(8)
and close > open
and close 3 days ago < ema(21)
and close 5 days ago < close 3 days ago
and close 5 days ago < ema(90)

And I added a line to the filter which contained a constraint for the linear regression slope - that looked like this

and linear regression slope(45) < 0

After testing the 45 day version I tried the linear regression slope less than 0 for a 15 day period and a 30 day period. And then I changed the less than 0 to greater than 0 -
and linear regression slope(45) > 0

And tested every version in that configuration and here are the results


What this shows is that the original cross over v6 has a good win percentage, a good short term (4 day) ROI and a good 30 day net change. It also has a good number of selections. None of the other filters quite matched or exceeded these results in total. But there are some things to learn from this.

If you want a filter that doesn't pick many stocks but those that it picks have a high probability of winning with a great reward to risk factor and a super ROI then you would use the linear regression slope for 30 days greater than 0.

On the other hand while the filters where the linear regression slope was less than 0 did not match the original, they weren't too awfully bad either. That suggests that maybe combining the LRS with the cross over isn't such a good idea but maybe the LRS less than 0 has some promise either on its own or combined with another good filter.

Something to think about - something to look into.

Sunday, April 22, 2007

A New Approach

It was too nice a weekend to sit and update the old BLog so I hope you all did something special with family and friends as did I.

But while I was enjoying the weather and continuing my quest to get my veggie garden ready I came up with a new idea.

Some months ago I showed you all a filter that captured stocks when the MACD first crossed below the 0 line rather than waiting for it to reappear in positive territory. I suggested at that time that by the time you caught the MACD on the upswing most of the move was probably done and you would only be getting the leavings.

This filter is much the same except I'm using the linear regression slope (LRS) coupled with an RSI(2). Again my preference for filters is to use indicators that are as close to real-time as I can get them and the linear regression slope is one of those critters. Also the RSI(2) is about as close to real-time as you can get and still have an indicator of some kind.

Instead of picking a single point in time for either of the indicators I'm looking for a process - I want the RSI(2) to be descending and I don't care what the values are and I want the linear regression slope to be ascending with the only caveat that it was less than zero 5 days ago. In other words the stock is showing some momentum slowdown (RSI) but at the same time it is reversing its course (LRS). As readers of this log know - stocks slow down and stop before they reverse course - in both directions.

The LRS takes a bit to move it - it is a large boat and large boats require a lot of time and water to turn around. The RSI on the other hand is a speedster and it moves pretty quickly up and down. Here is the filter -

Show stocks where close is between 15 and 35
and Average Volume(90) is above 500000
and rsi(2) has been decreasing over the last 1 week
and linear regression slope(45) has been increasing over the last 1 week
and linear regression slope(45) < 0 5 days ago
and draw cma(pp,4)


The line regarding the cma(pp,4) can be ignored for now - it is just something else that I'm working on. Generally speaking from observation only it can be used to enter the stock (close > custom moving average(pp,4)) and as an exit method - (close < cma(pp,4). I didn't test that, I only observed it.

A typical selection looks like this -


It back tests nicely as a good swing trade selector - short term it is merely adequate. The numbers were 61% win ratio, 1.52 reward/risk and 39.11% ROI short term. But where it excelled was in the 30 day region where it returned a 6.94% net and that is fantastic.

So if you are looking for a filter that finds depressed stocks that are on the mend - this is it. It doesn't pick very many - about 1 every other day or so - but those it selects are generally green at the end of a week.