Market Filters - Build, refine, execute and test trading strategies Login or register to start analyzing the market.
Get ratings for symbol:

Article - Building a Technical Buy Signal

See the full list of articles.

2006-06-13

Introduction

Building a good buy signal based on technical indicators is the goal of many traders and investors. This can be very time-consuming without the right tools, but back-testing can expedite this process.

This article is intended to outline a scientific process for finding and testing a buy signal. Testing and repeatability should always be the basis for any scientific research.

Note

We should note up front that back-testing is a tool and not a definitive gauge of the performance of a signal in reality. Back-testing is a simulation and real-life circumstances will always be different. However, back-testing is immensely useful when comparing signals because they're being used in a completely similar and repeatable method.

Goal

Our goal at the end of this process is to find a set of technical indicators that consistently finds "good" trades for the user. What "good" means will vary depending on the user for reasons such as the amount of time they're willing to hold a stock, etc.

Once we've found such a signal we can then run it on live market data to find the highest ranked stocks for consideration.

Starting point

There are so many options when considering technical indicators that it's normally useful to pick an arbitrary starting point. Let's pick RSI since that's as good a start as any other.

Back-testing

Now that we have a starting point we run a test using the "historical analysis" feature on the website. We select the RSI indicator from the list of available ones. For this research we'll set it to run over 2 years of data, starting with $10,000 and using no transaction fees. Transaction fees are important but we'll ignore them for now since we're just trying to compare signals.

Note
Market Filters is focused mainly on the development of buy signals but for back-testing purposes it uses a uniform sell signal in all cases. Using a similar algorithm helps eliminate the sell signal as a factor in the results and allows us to focus just on comparing the effectiveness of buy signals.

Once we select to run the test we'll later receive an email with the results. In this case they're not encouraging:
Indicators% GainWin %Loss %Avg Win %Avg Loss %
RSI6.65%65.31%34.69%5.33%6.57%

Briefly, "% Gain" is the change in portfolio value during the test, "Win/Loss %" are the percentage of winning or losing trades, and "Avg Win/Loss %" are the average amount of money gained or lost per winning or losing trade.

Analysis

A gain of 6.65% over a 2 year period isn't good, plus if we had considered transaction fees this would have been a big loss. Over the same period the S&P gained about 12% so that should be one metric for us (the DJI gained about 2%).

Attempt #2

Let's try adding another indicator to this buy signal to improve it. Since RSI is a lagging price momentum indicator, and the Market Filters implementation is geared towards finding underbought stocks, let's try adding something to help find the big dips faster. Looking at all the indicator types available, Fastest Decreasing Price seems worth a try since it will assign high scores to very recent price drops.

Note
The way indicators are grouped on Market Filters is simple from a users perspective: select more than one for your analysis. Behind the scenes the analysis algorithms will score the entire market for each indicator separately then combine and normalize the results.

The results that come back are an improvement:
Indicators% GainWin %Loss %Avg Win %Avg Loss %
RSI + FDP15.81%71.43%28.57%6.87%9.42%

This is a good improvement, over 3x the gain vs. plain RSI. It's still barely higher than the gains of the S&P, so we could have gotten similar results without having to actively manage a portfolio by using an index fund. We need something better.

Note
A note of caution here. As we look for very large recent price drops we are making a larger risk/reward tradeoff. The markets have been (arguably) bullish over the last few years so this tradeoff works well but might not in a bear market. That can be investigated further separately.

Attempt #3

We had good success last time by adding another indicator to the mix, so let's try that again. Here let's use two more indicators that will further accentuate recent price drops, Below Open Frequency and Below 50-day Moving Average.

The results that come back are mixed:
Indicators% GainWin %Loss %Avg Win %Avg Loss %
RSI + FDP + BOF2.07%66.67%33.33%6.94%14.54%
RSI + FDP + B5034.02%76.67%23.33%7.64%12.66%

Clearly Below Open Frequency does not perform well, however the addition of Below 50-day MA doubled our gains. This is encouraging.

Attempt #4

One avenue we haven't yet explored is the concept of restricting the space of stocks to consider for trading, simply called "filters". Low-priced stocks are typically the target for active traders so let's follow suit. The typical "penny stock" definition are those priced under $1, but let's give ourselves more room by setting the maximum at $2 using a Price Filter.

The results that come back are mixed:
Indicators% GainWin %Loss %Avg Win %Avg Loss %
RSI + FDP + PF[0,2]64.03%65.32%30.65%14.47%17.54%
RSI + FDP + B50 + PF[0,2]67.35%72.93%26.32%11.51%16.35%
RSI + FDP + BOF + PF[0,2]33.65%72.27%26.89%9.70%18.19%

Analysis

Clearly restricting ourselves to the lower-priced stocks has a huge impact. We should note that results using penny stocks are inherently less precise than otherwise since it's not always possible to use the last trade price as the basis for the next trade. However, such a drastic difference here is very telling.

Attempt #5

If we're at all concerned about the reliability of back-testing against penny stocks, we can try to restrict ourselves further. The stocks that might be most prone to errors in simulation would be extremely low-volume ones, since their current "market price" is more difficult to determine. Let's add a volume filter of at least 100,000 stocks traded daily to the mix.

The results are not surprising:
Indicators% GainWin %Loss %Avg Win %Avg Loss %
RSI + FDP + PF[0,2] + VF[100k,100m]47.02%69.53%29.69%11.12%16.91%

A gain of 47% is still good compared to 64% without the volume filter. Day traders are often not scared by low volumes, so it may not concern everyone.

Conclusions

We've been able to find a buy signal that provides decent gains over multiple years. The next step would be to choose another starting point and repeat a similar process. There are many good signals out there.

Feedback

Please send us any feedback or requests for other analysis to feedback.


(c) 2008 MarketFilters.com
All information provided "as is" for informational purposes only, not intended for trading purposes or advice. Market Filters is not liable for any informational errors, incompleteness, or delays, or for any actions taken in reliance on information contained herein.