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

    • Be careful who you blame.   I can tell you one thing for sure.   Effective traders don’t blame others when things start to go wrong.   You can hang onto your tendency to play the victim, or the martyr… but if you want to achieve in trading, you have to be prepared to take responsibility.   People assign reasons to outcomes, whether based on internal or external factors.   When traders face losses, it's common for them to blame bad luck, poor advice, or other external factors, rather than reflecting on their own personal attributes like arrogance, fear, or greed.   This is a challenging lesson to grasp in your trading journey, but one that holds immense value.   This is called attribution theory. Taking responsibility for your actions is the key to improving your trading skills. Pause and ask yourself - What role did I play in my financial decisions?   After all, you were the one who listened to that source, and decided to act on that trade based on the rumour. Attributing results solely to external circumstances is what is known as having an ‘external locus of control’.   It's a concept coined by psychologist Julian Rotter in 1954. A trader with an external locus of control might say, "I made a profit because the markets are currently favourable."   Instead, strive to develop an "internal locus of control" and take ownership of your actions.   Assume that all trading results are within your realm of responsibility and actively seek ways to improve your own behaviour.   This is the fastest route to enhancing your trading abilities. A trader with an internal locus of control might proudly state, "My equity curve is rising because I am a disciplined trader who faithfully follows my trading plan." Author: Louise Bedford Source: https://www.tradinggame.com.au/
    • SELF IMPROVEMENT.   The whole self-help industry began when Dale Carnegie published How to Win Friends and Influence People in 1936. Then came other classics like Think And Grow Rich by Napoleon Hill, Awaken the Giant Within by Tony Robbins toward the end of the century.   Today, teaching people how to improve themselves is a business. A pure ruthless business where some people sell utter bullshit.   There are broke Instagrammers and YouTubers with literally no solid background teaching men how to be attractive to women, how to begin a start-up, how to become successful — most of these guys speaking nothing more than hollow motivational words and cliche stuff. They waste your time. Some of these people who present themselves as hugely successful also give talks and write books.   There are so many books on financial advice, self-improvement, love, etc and some people actually try to read them. They are a waste of time, mostly.   When you start reading a dozen books on finance you realize that they all say the same stuff.   You are not going to live forever in the learning phase. Don't procrastinate by reading bull-shit or the same good knowledge in 10 books. What we ought to do is choose wisely.   Yes. A good book can change your life, given you do what it asks you to do.   All the books I have named up to now are worthy of reading. Tim Ferriss, Simon Sinek, Robert Greene — these guys are worthy of reading. These guys teach what others don't. Their books are unique and actually, come from relevant and successful people.   When Richard Branson writes a book about entrepreneurship, go read it. Every line in that book is said by one of the greatest entrepreneurs of our time.   When a Chinese millionaire( he claims to be) Youtuber who releases a video titled “Why reading books keeps you broke” and a year later another one “My recommendation of books for grand success” you should be wise to tell him to jump from Victoria Falls.   These self-improvement gurus sell you delusions.   They say they have those little tricks that only they know that if you use, everything in your life will be perfect. Those little tricks. We are just “making of a to-do-list before sleeping” away from becoming the next Bill Gates.   There are no little tricks.   There is no success-mantra.   Self-improvement is a trap for 99% of the people. You can't do that unless you are very, very strong.   If you are looking for easy ways, you will only keep wasting your time forgetting that your time on this planet is limited, as alive humans that is.   Also, I feel that people who claim to read like a book a day or promote it are idiots. You retain nothing. When you do read a good book, you read slow, sometimes a whole paragraph, again and again, dwelling on it, trying to internalize its knowledge. You try to understand. You think. It takes time.   It's better to read a good book 10 times than 1000 stupid ones.   So be choosy. Read from the guys who actually know something, not some wannabe ‘influencers’.   Edit: Think And Grow Rich was written as a result of a project assigned to Napoleon Hill by Andrew Carnegie(the 2nd richest man in recent history). He was asked to study the most successful people on the planet and document which characteristics made them great. He did extensive work in studying hundreds of the most successful people of that time. The result was that little book.   Nowadays some people just study Instagram algorithms and think of themselves as a Dale Carnegie or Anthony Robbins. By Nupur Nishant, Quora Profits from free accurate cryptos signals: https://www.predictmag.com/    
    • there is no avoiding loses to be honest, its just how the market is. you win some and hopefully more, but u do lose some. 
    • $CSCO Cisco Systems stock, nice top of range breakout, from Stocks to Watch at https://stockconsultant.com/?CSCOSEPN Septerna stock watch for a bottom breakout, good upside price gap
    • $CSCO Cisco Systems stock, nice top of range breakout, from Stocks to Watch at https://stockconsultant.com/?CSCOSEPN Septerna stock watch for a bottom breakout, good upside price gap
×
×
  • Create New...

Important Information

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