How to Build a Trading Strategy – Part 5
Additional Filters
Both entry and exit rules can be thought of in terms of how strict they are, i.e. how easy or difficult they are to achieve. You might also say that strictness is a measure of how frequently or infrequently the rule conditions occur. For the gap percentage that forms the core of our strategy, higher values are more strict (less likely to occur) than lower values. Generally, adding more entry rules (filters) also has the effect of making the entry stricter. For example, if we added a rule that the stock had to close above its 200-day moving average before entering a long trade, that would qualify as an additional filter.
Stricter entry rules will be satisfied less frequently than more lenient entry rules, and thus a strategy that relies on the stricter rules will generally generate fewer trades than a strategy whose entry rules are more easily satisfied. With a robust strategy, the reward for fewer trades is generally a higher gain per trade, on average. If you add a filter that reduces the number of trades but does not improve the test results, then that filter is not providing any benefit to your strategy.
The strictness of exit rules has little effect on the number of trades generated by the strategy. However, just like the entry rules, stricter exit rules typically result in higher average profits. Why? Because stricter exit rules tend to keep you in your trades for a longer time, giving the stock more time to experience the mean reversion behavior that we’re attempting to exploit with a strategy like the one being developed here. Thus, for entries the tradeoff is between more trades and higher gains per trade, while for exits the tradeoff is between shorter trade durations and higher gains per trade.
We will talk more about exits in the final part of this series. For now, let’s see if additional entry filters have any positive effect on our test results. First, we’ll add a rule that requires the stock to be above the 200-day moving average on the setup day of a long trade, and below the MA(200) on the setup day of a short trade. The updated test results are below.
Using MA(200) as an Additional Filter
As we predicted, adding a filter drastically reduced the number of trade signals generated during the back-testing period. On the long side, the filter also reduced the Average % P/L and had a slightly negative effect on Win Rate as well. The change was slightly more positive on the short side, where Average % P/L stayed about the same, and the Win Rate increased slightly. Overall, however, it doesn’t appear that this filter is worth pursuing, so we’ll abandon it.
Perhaps we need to identify more pronounced pullbacks and surges. One way to do this would be to require a few down closes in a row on the long side, and a few short closes in a row on the short side. We could express these additional setup filters quantitatively as:
Long Rules
- A Buy Setup occurs when all of the following conditions are true:
- MA (Vol, 21) > 2,500,000
- Close > $5
- The stock closes lower than the previous day’s close for N days in a row,
where N = 2, 3, 4
- Buy the stock when:
- The previous day is a Buy Setup
- Today’s Open < Previous Day’s Low * (1 – X%)
- Sell at the close on the day of entry
Short Rules
- A Short Setup occurs when all of the following conditions are true:
- MA (Vol, 21) > 2,500,000
- Close > $5
- c. The stock closes higher than the previous day’s close for N days in a row,
where N = 2, 3, 4
- Short the stock when:
- The previous day is a Short Setup
- Today’s Open > Previous Day’s High * (1 + X%)
- Cover at the close on the day of entry
Note that by adding one new filter with three possible values to test, we will now have three times as many results to sift through. As you develop a new strategy, you may find that you have hundred or even thousands of different variations.
The updated results are shown below.
Using N Up or Down Days as an Additional Filter
There are several things to notice here. First, the Average % P/L increased on both the long and short sides, although the change is more pronounced on the long side where we now see average gains per trade of over 4%. The Win Rate has also increased for both long and short versions of the strategy.
However, it appears that some of our variations may be getting too restrictive, because they did not generate many trade signals during the 12-year back-testing period. It is up to you to decide when trade signals are too infrequent, but we often ignore variations with less than 200 trades over a 10-12 year period. The table below shows the top 10 long and short variations as ranked by Avg % P/L, ignoring any variations with less than 200 trades.
Top 10 Variations, By Average % P/L
You may wish to experiment with additional filters to see how the results change. Some traders like to add each new filter to the central thesis independently, while others prefer to keep layering each new filter on top of all the previous ones. Either of these approaches will work, as long as you end up with a well-defined strategy that produces results that you consider worthy of your time and trading capital
In the next installment we’ll turn our attention to exits.
Click here to read How to Build a Trading Strategy – Part 1
Click here to read How to Build a Trading Strategy – Part 2
Click here to read How to Build a Trading Strategy – Part 3