This is the third part in our FirstStrike Trading System series. Within the previous article, we discovered what might be a solid look-back period for our regime filter. I ended that article with an idea that a trend strength filter might be a big help. The indicator I had in mind was the Trend Strength Indicator (TSI). If you are not familiar with it, you can learn more about it here and you can download the code here. Briefly, this indicator is used to help determine the trendiness of the market. The larger the TSI value, the more price action is trending. The smaller the TSI value the more choppy price action is. Let’s apply this to the FirstStrike system to see if we trade only strong trending markets, if we can improve the strategy performance.
Trend Strength Filter
So, how do we do this? The TSI indicator provides us with a decimal number. We need to determine the threshold that will divide a trending market from a non-trending market. Often with the TSI indicator values above 1.6 are considered trending. However, let’s use TradeStation’s backtesting feature to optimize over this threshold value. Long and Short trades can have different characteristics thus, I would like to locate a unique TSI threshold for long trades and a unique value for short trades.
First we revert back to our baseline system with no regime filter. Why? I want to avoid over curve fitting the TSI threshold to the historical data. It would be very easy to add our TSI indicator to our existing system with our regime filter. But doing so would increase the risk of curve fitting. We need to test our different filters independently. Thus, we don’t test our trend strength filter on our modified system. We must test it on the original system to see if it produces any improvement. If it does, only then do we introduce it to our modified system.
First, I will optimize the TSI threshold value over the range of .5 to 2.0 in increments of .1 while only taking long trades. This produces the graph below.
Between the values .9 and 1.4 we can see a stable region with high net profit. By picking the middle value (average of the sum, .9 + 1.4) of 1.1 we should have a decent threshold for long trades.
Next I will perform the same iteration over the TSI threshold values while only taking short trades. This produces the graph below.
Between the values .5 and .9 we can see a stable region with high net profit. By picking the middle value (average of the sum, .5 + .9) of .7 should be a decent threshold for long trades.
Using these two TSI thresholds we can now compare the results to our baseline system. These values can now be entered into the trading system by these two inputs.
Bull_TrendThreshold(1.1),
Bear_TrendThreshold(.7),
Within our code we set four boolean flags to indicate the current state of the market.
// Set TSI Flags
Bull_TSITrend = TSI_Value > Bull_TrendThreshold;
Bear_TSITrend = TSI_Value > Bear_TrendThreshold;
Bull_TSINonTrend = TSI_Value < Bull_TrendThreshold;
Bear_TSINonTrend = TSI_Value < Bear_TrendThreshold;
By adding the TSI filter to our system with the Regime filter we have divided the market into four possible environments:
- Bull Market Trending
- Bull Market Non-Trending
- Bear Market Trending
- Bear Market Non-Trending
Below is the results of applying the TSI filter to our Baseline system.
Baseline System | Trend Strenth | |
---|---|---|
Net Profit | $47,063 | $56,388 |
Profit Factor | 1.20 | 1.26 |
Avg $ Per Trade | $105.52 | $127.57 |
All our performance values are up. We make more net profit, increase our profit factor and the net profit per trade. While these numbers may not be a huge change they are significant. Utilizing the TSI indicator does appear to be doing the job it was intended. That is, finding trades that generate more dollars per trade.
Time to combine our two filters. Let’s apply our new TSI filter to the system with our Regime filter and see what happens.
Baseline System | Trend Strenth | Trend Strenth & Regime | |
---|---|---|---|
Net Profit | $47,063 | $56,388 | $59,938 |
Profit Factor | 1.20 | 1.26 | 1.37 |
Avg $ Per Trade | $105.52 | $127.57 | $166.96 |
That’s more of a positive change. When we combine the TSI filter with our Regime filter we get good results when compared to our baseline system. Remember, both the TSI threshold and Regime look-back period were independently tested. Only now are they combined together.
You can see another example of doing this within the article, Two Dimensional Market Environment Filter. With our trading system, as it stands now, we are only going to actively trade when the market is trending. This makes sense given FirstStrike is a trend following system.
Profit Target For Long Trades
If you will recall from the previous article in this series, I was noticing there seems to be a sell-short bias to this system. Long trades tended not to perform as well as the short trades. This was true for our Regime based system and our most recent system where we added TSI. While it’s not a horrible disparity and it does appear the TSI filter has helped, in the back of my mind I still have this idea that a profit target on the long side might prove interesting.
To test a profit target for long trades we perform the same process as when testing TSI. We go back to our baseline system and apply our profit target to see what kind of results we get. In the graph below I test a range of profit target values from 500 – 2000 in increments of 100. This produced the following graph of net profit results.
I chose the midpoint value between $1,600 and $1,900 which is $1,750. Applying this to our Baseline system we get the following results.
Baseline System | Profit Target | |
---|---|---|
Net Profit | $47,063 | $54,588 |
Profit Factor | 1.20 | 1.34 |
Avg $ Per Trade | $105.52 | $152.05 |
The profit target does help ever so slightly. Is it enough to justify adding? Maybe. Let’s add it to our trading system and see if it improves it. We will add this to our latest system that contains our regime filter and TSI filter.
Without Profit Target | With Profit Target | |
---|---|---|
Net Profit | $59,938 | $50,213 |
Profit Factor | 1.37 | 1.23 |
Avg $ Per Trade | $166.96 | $112.58 |
Adding the profit target took us in the wrong direction. All key performance values are down. It seems while the profit target does help when applied to the base line system, when we add it with our TSI filter and Regime filter it does not work as well. My speculation is both the TSI and Regime filter have already eliminated trades that might have benefited from a profit target. Remember, FirstStrike is a trend following system, thus trading only with a high TSI (strong trending market) makes sense. When we are trading with a strong trending market it makes sense to allow profits to run. We do that by not limit our profits based on a static profit target. In short, TSI also helps us more by finding a strong trending market than simply applying a profit target.
Other ideas to test might include taking a profit target when trading in the wrong regime. That is, take long trades when in a bear market regime yet, exit those trades with a profit target. It’s an interesting idea and worth testing. However for now, I’m going to forgo the profit target idea and stick with our system that only exits trades at the end of the week.
Summary
So, where do we stand? At this time with all our testing we have added only two simple filters to our baseline system. These filters were independently developed and tested. Once these two systems were combined, we found they worked well together. Because these two filters were independently tested we have reduced the likelihood of curve fitting. We also discovered a profit target does not appear to help our system much.
Baseline System | Modified System | |
---|---|---|
Net Profit | $47,063 | $59,938 |
Profit Factor | 1.20 | 1.37 |
Avg $ Per Trade | $105.52 | $166.96 |
That’s it for now, but there is still a lot we can test.
What’s the difference between optimizing the profit target on the baseline trade then adding to the modified system and simply optimizing the profit target on the modified system? I like your reasoning for doing the former (so as not to overfit) but if you then choose to use it or not based on the combined equity curve then that seems overfitting what you just made an effort to not overfit. Does that make sense?
Hello Mark. I think I understand what you are asking. By optimizing on the baseline system you are not taking into account other filters or variables which can increase the chances of curve fitting due to the interaction of the two filters. In short, you really want to avoid optimizing parameters when multivariables are being used. The more parameters you have, the more optimized the system. The more optimized the system, the more you increase the chance of curve fitting. Thus, I optimize values interdependently. If you do independently optimize two filters then introduce them to together and make a decision not to use one of the filters, yes you are optimizing and may be curve fitting. However, you can never completely get away from curve fitting. It’s always a possibility of life, much like getting into an auto accident when driving. You do your absolute best to minimize the chance. However, you must get into your car to reach your destination and you must make decisions and put your money at risk to reach your trading goals.
Well said. Thanks!
Dear Jeff,
I am eagerly waiting the next episode of this series. Do you have an idea when it will be ready?
thanks so much.
Andras
Andras, you’re right it has been a while. I’ll put this on the list for future articles. I’ll try to get to it soon. The earliest would be late August, however. Thanks for letting me know you’re interested in seeing new articles on First Strike.
Thank you Jeff for the quick response,
Yes, I have been waiting for the 4th article 🙂 It is very interesting how you approached it and I am eagerly awaiting your results as I am not a programmer, so it is hard for me to back test this much data (I do it manually, takes for ages).
keep up the great work..
Andras