Jump to content

Welcome to the new Traders Laboratory! Please bear with us as we finish the migration over the next few days. If you find any issues, want to leave feedback, get in touch with us, or offer suggestions please post to the Support forum here.

  • Welcome Guests

    Welcome. You are currently viewing the forum as a guest which does not give you access to all the great features at Traders Laboratory such as interacting with members, access to all forums, downloading attachments, and eligibility to win free giveaways. Registration is fast, simple and absolutely free. Create a FREE Traders Laboratory account here.

jswanson

Trend Testing Indicators For Adaptive Trading Systems

Recommended Posts

Often when designing a system it’s important to keep the big picture in mind. What is the overall market doing? The most simple way to accomplish this is to break the market into two modes: bullish or bearish. We are all aware that price action is a mirror of human psychology therefore price action is different between these two modes. Sudden market plunges that we see within strong bear markets, such as in 2008, behave much differently when contrasted to the continual grinding, upward market we saw in late 2009 and 2010. People behave differently under fear (how low can it go) and pain (look all the money I lost) vs. doubt (this can’t be going higher) and greed (I’ll just make a bit more before I exit). Since people behave differently under these two market modes it makes sense that we should design trading systems that take advantage of the different market characteristics for each mode. We want to build a system that dynamically adjusts its trading parameters based upon which market mode we are experiencing. To do this we can use an indicator.

 

The most simple way to divide the market is to use a 200-period simple moving average (SMA). When price is above it we are in a bull mode. When price is below it, we are in a bear mode. This simple concept can improve many trading systems. I’ve personally used this technique many times. Yet there are other techniques to divide a market and some of these might produce better results than our old reliable 200-day SMA. In this article I want to take a look at a few different methods and test them on several markets.

 

The indicators we are going to test are:

  1. SMA(140)
  2. Rate of Change (ROC)
  3. Smoothed Adaptive Momentum
  4. Relative Strength Ranking (RS Rank)

 

The Smoothed Adaptive Momentum and Relative Strength Ranking are two indicators you may not be aware of. First, the Smoothed Adaptive Momentum was created by John Ehlers. It’s a complex indicator and more then I want to get into during this article. Google it if you wish and you can also find the EasyLanguage code here. As for the RS Rank, you can find more about here. I will say this about the RS Rank for now, traditionally it’s used as a ranking tool to compare a group of stocks or ETFs to determine which specific instrument is performing best. As its name implies, it ranks each instrument based on how well the instrument has been performing. You can then compare this score to the other stocks or ETFs in your basket of trading instruments. Thus, you can simply pick the instrument with the highest RS Rank score when creating a momentum based trading system. In this article I’m using it for a completely different purpose and was curious on how well it would hold up.

 

We are going to use a 140 day period for all our examples. 140 days represents about seven months of trading if you figure there are about 20 trading days per month. This is not a magic number by any means. I was first going to pick 120 days because this represents half a year. However, it seemed too obvious a choice so I pushed it back to seven months. I did not want to pick a smaller number than six months because I don’t want the buy/sell signals to occur very often. The idea is capture the long term market mode, not every market gyration. I did not want to look at 200 either. I wanted to do something a little different. Maybe we can find something more responsive than a 200-day SMA. Of course I encourage you to perform your own testing as well.

 

The strategy code to test the effectiveness of these different indicators is rather simple. We are only going long during a bull market and closing our position when that bull market switches to a bear market. In essence we are creating a very simple trend following system. For each indicator the transition is based upon:

 

  • SMA: Bull market when price is above the SMA
  • ROC: Bull market when indicator value is above zero
  • Smoothed Adaptive Momentum: Bull market when indicator value is above zero
  • RS Ranking: Bull market when indicator value is above zero

 

First I will take a look at the SPY ETF.

 

S&P 500 ETF (SPY) FROM 1993 – 2011

 

SPY-Trend-Test.png

 

The chart above compares our four different methods vs. some common system performance metrics such as profit factor and average net profit. The bar graph specifically compares each system’s profit factor score. Here we can see the RS Rank has clearly performed better at distinguishing between a bull or bear mode. The ETF history is not very extensive, so let’s take a look at the cash index, which goes back to 1960, and see what the results look like.

 

S&P 500 INDEX (SPX) FROM 1960 – 2011

 

SPX-Trend-Test.png

 

Here we can see even going back to 1960 on the S&P 500 cash index that RS Rank does a nice job. What about the futures market? Let”s look at the S&P E-mini.

 

S&P 500 E-MINI (ES) FROM 1998 – 2011

 

ES-Trend-Test.png

 

Now we see a huge difference from the previous two markets. Notice all the profit factors are below 1. This means the strategy performance produces a loss. On the ETF and Cash index all indicators produce a positive result. What’s going on? The futures market is a different beast. The trending characteristics of the S&P E-mini market is very weak. In fact, much has been written about the mean reversion characteristics of the S&P 500 E-mini index futures market. Our study is simply confirming this fact.

 

Based upon what we know now, if you were going to design a trading system to trade the S&P 500 ETF it appears using the RS Rank would be a good choice. On the other hand, if you were going to use the E-mini as your market you might want to use the SMA. This is in fact what is done with our Aurora trading system. While the SMA does not perform well as a trading system, it does do a good job of breaking the market into the two bullish or bearish modes. Often you will see increased performance in your trading systems by utilizing a SMA filter for the E-mini.

 

Let’s look at a different market. The Euro currency market. First up is the ETF.

 

EURO CURRENCY ETF (FXE) FROM 2006 – 2011

 

FXE-Trend-Test.png

 

We don’t have much historical data to look at, so these results don’t mean a whole lot. However, they do appear consistent with our results from the S&P 500 ETF results. There appears to be one clear winner: RS Rank. We have more historical data on the futures market so, let’s look at that.

 

EURO CURRENCY FUTURES (EC) FROM 2001 – 2011

 

EC-Trend-Test.png

 

The above bar graph is the same as the Euro ETF! From the graph above we can see the futures market for the Euro has solid trending characteristics. We also see, once again, RS Rank shines. However, the number of trades is low, but do we see a pattern?

 

Based on these limited tests RS Rank show superior results when determining a bull market from a bear market. The exception is the S&P 500 E-mini. In the case of the S&P 500 E-mini a simple moving average appears to be the better indicator. I would imagine similar results would be found between the DOW futures vs the DOW ETF.

 

In summary, put this to use in your own efforts at building a trading system. Use an indicator to determine the market mode and trade accordingly. The point here is to have your automated trading system automatically adapt to a changing market. For example, when the market is bullish you may want to look for longs only while ignoring shorting opportunities. Or if the market is within a bearish mode the criteria for entering a long position might be stricter than when in a bull market. Too often people simply trade the same setup or method during different market conditions. By breaking the market up into two modes, you are making your trading system dynamic and adaptive to the changing market.

 

There are ways to segment a market further. In a future post I will discuss how to segment a market into four distinct modes. Each of these four modes can be used to further adapt your trading system.

Share this post


Link to post
Share on other sites

Our team at beathetread we did something different but in the same line of investigation.

We formed a hypothesis that the most important thing for adaptive systems is to know the moment of adaptation and to optimize only on the current market patterns.

 

The Elliottware approach is a machine learning extension of the Elliott wave principle.

The key is to find a stable structure and to train your algorithms on it.

 

The sampling should be adaptive and the human pattern recognition is a key aspect.

Share this post


Link to post
Share on other sites
The futures market is a different beast. The trending characteristics of the S&P E-mini market is very weak. In fact, much has been written about the mean reversion characteristics of the S&P 500 E-mini index futures market. Our study is simply confirming this fact..

 

Thanks for an introduction to a handful of indicators I've never looked at before.

 

With regard to the point above, my expectation would be that the ETF would be more mean-reverting than the future (although I agree that the trending quality of both is poor). When you were testing, did you test against the @ES.D cash session data, as this would really be the true equivalent for the SPY, which only trades exchange hours?

 

Bluehorseshoe

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Topics

  • Posts

    • @sxiqxx, Well done on making your first post a promising strategy. @everyone, post up if you want this coded into an EA. Although I switched to TradeStation, I still have an active MT5 demo with MetaEditor. I can code it without referencing object oriented programming which should be retroactively compatible with MT4. Let me know...
    • Please allow me to retort (in jest): RESPONSE 1 : Get a job supervising others where you're in control of performance reports and ride those others 100%. This makes your performance 100% with little to no effort.   RESPONSE 2: Feel free to piss off your boss but stay nonviolent. When the side effects of his viagra and testosterone boosters cause him to physically assault you, you have the legal upper hand. This can result in a boatload of trading capital.   RESPONSE 3: Feel free to have intimate relations with your boss if she finds you attractive. Rest assured that mum's the word because once again, you have the legal upper hand. This can also result in a boatload of trading capital.   RESPONSE 4: Don't be fake friends with any enemies... unless you need information from them. Being fake friends with everyone will cause you to become an empty shell of a person with no direction in life.   REPONSE 5: Get your boss to become reliant on your performance (really, just the performance of your subordinates), and then plan an "overheard" conversation wherein you fake an interview with another potential employer. You'll probably get a pay increase or a promotion.   RESPONSE 6: If you can give your 75% percent to a project, give 50% and rely on your legal upper hand(s). Learn to write trading algo's during your other 50%.   RESPONSE 7: Take all of the office boys out to nightclub where you merely sip soft drinks on a weeknight. Upon your return to the office in the morning, inform the security guards that all of the office boys are intoxicated. Your boss will love you for it.   RESPONSE 8: Never try to prove your client wrong or find faults in their processes, but do secretly collect their information in case you jump ship or "someone you know" decides to start his own company.   RESPONSE 9: Never stay in a firm for too long. Instead, use your ill-gotten capital to exit the rat-race and start trading.   RESPONSE 10: Trading pays more than your career. Interpersonal skills are now irrelevant. Use your technical skills for trading. Never stop learning and keep updating your technical skills.😁
    • There are a lot of trading strategies like elliot waves, wyckoff etc so we need to apply those who best suited to our need and are understandable too.
    • Scalping can be good during the high volatile markets however the new traders should be careful while entering and exiting the markets too quickly since they can make losses as well. If the broker support news trading we can make most out of the scalping in my opinion.  
    • In my opinion these candlestick charts are more easier to understand as compared with the other charts.
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.