Showing posts with label back testing. Show all posts
Showing posts with label back testing. Show all posts

Friday, May 04, 2007

Re-Testing BOB

We've been discussing BOB a lot on this site and on Bullish Jim's and Jim has even provided some modifications which we've adopted.

At any rate every so often I re-test my filters against the most recent period and compare them to the previous period tested. This is done to ensure that I’m using the most efficient filters in my toolbox for the current market conditions. Here are the results of that re-testing for the stable of BOB’s we have managed to collect. As you will see and what I often find is that last month's darling is this month's dog.


From a reward/risk standpoint BOB v32x with 1.89 is far and away the best filter for use in the current time period. Here is that code.

show stocks where close is between 15 and 35
and average volume(90) > 500000
and close 2 days ago < ema(8) 2 days ago
and close 1 day ago < open 1 day ago
and close 1 day ago is less than 1% < open 1 day ago
and close 2 days ago is less than .5% < open 2 days ago
and low 1 day ago < low 2 days ago
and volume 1 day ago is more than 20% > volume 2 days ago
and close > open
and low > low 1 day ago
and close 2 days ago < ema(8)
and close 2 days ago < open 2 days ago


You should also note in your trading notebook that a change of date can cause filter results to vary significantly - the important thing to take away from that is if you are using some ready-made screen provided by one or another of the various sites - are you sure it is still working?

You see as much as we want to believe that CANSLIM or the "way of the turtle" or even that "Thursday's have the highest percentage of gap fills" are the solutions to all of our problems because learned books have been written about them - the fact is - nothing works all the time.

As the Gipper said - Trust - but verify.

Saturday, March 17, 2007

Re-Testing Filters

Fiddling around this morning and so I decided to run some updated tests on my favorite filters and show you the results - or - what a difference a month can make. Actually I'm glad that we got this dip to work with because it helps assess the various filters in bad times as well as good.



You can see that I've retested against two separate 80 day periods - one overlapping the other. I began with the basic filter – the basic filter is the filter that contains all of the common elements of every filter I develop such as price range, volume minimums, and any EMA or other overlays I might want to see on my charts. It is as vanilla as they get and even this filter produces a profit in good times when the selection is based on the highest volume of the output day. But if your win percentage can’t beat the basic filter then you probably don’t have a very good filter.

I followed that with the ATR and RSI filter. Note that the Win percentage stayed close, as did the Reward/Risk ratio and the ROI.

The BOB filter also maintained a consistent win percentage but, as expected, it outputs a much better ROI when times are favorable – but 87% is nothing to sneeze at when times are not so good.

Break Out is the best of the bunch. Interesting item about this filter is that it isn’t as prolific as the others – only about 1 selection every other day but that maintained through both periods. In period 1 there were 44 selections and in period 2 there were 42. Of course, breakouts are the very best method regardless of time period.

You don’t need any special skills to be able to find breakouts or even any special software – you just need to be observant. In my next post I’ll show you how to visualize breakouts without a lot of special equipment, software, or even knowledge.

Thursday, January 11, 2007

Turtles – Again

The Turtles original method was based on Donchian channels. As I remember it they went long when the price went above the upper channel and short when it went below. Then they used risk management to keep them in the game. In other words if the stock kept running in their desired direction they stayed with it and if it came back the stop loss would take them out. They had many small losses and a few large wins and that’s what kept them solvent.

I wrote a filter using Donchian channels and set it up like the Turtles would have done – then I back tested it - I hate “many small losses.” I take enough as it is.

So I changed it – I set the filter to look for stocks that came back up through the lower Donchian channel after being below it for at least one close. This is what that looks like –



This output is actually for Wednesday's close - you can see that Glass responded well to the Donchian channel.

When I back tested it there were some absolutely great results. 62% win percentage and 75% annualized ROI. But the net change over time was where the real story was told – This has the potential to be a real intermediate (10 – 20 day) term filter.

NET Change
1 day - .04%
4 days – 1.07
10 days – 2.39
20 days – 4.33
30 days – 4.86

Donchian channels Marlyn’s way – it might be a winner.

Saturday, December 09, 2006

Back Testing Software

When I first started this site I decided not to have ads or do endorsements. I plan to continue with that position. Consequently if I say that I use this product or that product and that I might like them a lot it does not constitute an endorsement. Nor do I receive any compensation from any site that you might go to on my recommendation - nor do I wish to receive compensation for same.

So saying - I use a subscription version of stockfetcher.com for filtering and back testing. I highly recommend them for filtering purposes because you can use one of the many dozens of technical indicator based pre-built filters, modify any of the pre-builts to your own desires or develop brand new filters to do just about anything you might want them to. For example most of the pre-builts have a price consideration of 5 to 250. Maybe you want to concentrate on stocks between 15 and 25 - you can easily change the criteria to match your desires.

I'm currently playing with a filter where an exponential moving average crosses a simple moving average. You just can't get that kind of flexibility on most filtering sites (although I'm sure that I haven't tried them all).

Stockfetcher.com also has a back testing capability that permits you to run a back test using your filters for any period that you select. This is important because you can test your filters both for strong trending markets and weak falling markets (or down trending markets). If you do something like this (and I do often) you will be very surprised how a "can't miss" filter misses quite frequently simply because of market conditions.

Here is a recent example of the kinds of things you can gain from filtering with a technical bent. Readers of the site know that I like the exponential moving averages because they are far more sensitive to stock movements than are the simple moving averages. In fact a couple of weekends ago I did a cross comparison between the EMA 90 and the EMA 200 with good results for both but the 90 won the match. (At least in my mind anyway). Since then I have explored filtering with the EMA 90 for potential day trades and have been working on a particularly promising little filter. It is simply closing price is greater than EMA 21 and EMA 21 is less than EMA 90 - can't get much simpler than that. I use a price cutoff from 15 to 35 and volume doesn't much matter because I only take the four highest volume stocks out of the box.

On Friday those four happened to be BSX, FDC, RBAK and CVS. Watching the four during the day (using prophet.net - my favorite charting software) produced a super set-up on RBAK that looked like this -



Anyone could have taken this off the hammer in the third position to get a 60 cent gain in short time. I passed on this stock because I was working on something else at the time and I don't like having too many active at once.

(rant on) One other point - you can read every book on TA ever published and you will probably never see this method - that's the problem - everyone is using the old methods and no one is innovating. Thankfully we have software these days that allow those of us who are moderately creative to be able to test our ideas. That's what the quants at the hedge funds are doing - they are so beyond the simple moving averages that it isn't funny any longer. (rant off).

Again this is not an endorsement of stockfetcher, but it is a recommendation. I receive nothing from this so go try them out if you are interested in back testing or building truly technical indicator-based filters.