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

    • Date: 22nd November 2024.   BTC flirts with $100K, Stocks higher, Eurozone PMI signals recession risk.   Asia & European Sessions:   Geopolitical risks are back in the spotlight on fears of escalation in the Ukraine-Russia after Russia reportedly used a new ICBM to retaliate against Ukraine’s use of US and UK made missiles to attack inside Russia. The markets continue to assess the election results as President-elect Trump fills in his cabinet choices, with the key Treasury Secretary spot still open. The Fed’s rate path continues to be debated with a -25 bp December cut seen as 50-50. Earnings season is coming to an end after mixed reports, though AI remains a major driver. Profit taking and rebalancing into year-end are adding to gyrations too. Wall Street rallied, led by the Dow’s 1.06% broadbased pop. The S&P500 advanced 0.53% and the NASDAQ inched up 0.03%. Asian stocks rose after  Nvidia’s rally. Nikkei added 1% to 38,415.32 after the Tokyo inflation data slowed to 2.3% in October from 2.5% in the prior month, reaching its lowest level since January. The rally was also supported by chip-related stocks tracked Nvidia. Overnight-indexed swaps indicate that it’s certain the Reserve Bank of New Zealand will cut its policy rate by 50 basis points on Nov. 27, with a 22% chance of a 75 basis points reduction. European stocks futures climbed even though German Q3 GDP growth revised down to 0.1% q/q from the 0.2% q/q reported initially. Cryptocurrency market has gained approximately $1 trillion since Trump’s victory in the Nov. 5 election. Recent announcement for the SEC boosted cryptos. Chair Gary Gensler will step down on January 20, the day Trump is set to be inaugurated. Gensler has pushed for more protections for crypto investors. MicroStrategy Inc.’s plans to accelerate purchases of the token, and the debut of options on US Bitcoin ETFs also support this rally. Trump’s transition team has begun discussions on the possibility of creating a new White House position focused on digital asset policy.     Financial Markets Performance: The US Dollar recovered overnight and closed at 107.00. Bitcoin currently at 99,300,  flirting with a run toward the 100,000 level. The EURUSD drifts below 1.05, the GBPUSD dips to June’s bottom at 1.2570, while USDJPY rebounded to 154.94. The AUDNZD spiked to 2-year highs amid speculation the RBNZ will cut the official cash rate by more than 50 bps next week. Oil surged 2.12% to $70.46. Gold spiked to 2,697 after escalation alerts between Russia and Ukraine. Heightened geopolitical tensions drove investors toward safe-haven assets. Gold has surged by 30% this year. Haven demand balanced out the pressure from a strong USD following mixed US labor data. Silver rose 0.9% to 31.38, while palladium increased by 0.9% to 1,040.85 per ounce. Platinum remained unchanged. Always trade with strict risk management. Your capital is the single most important aspect of your trading business.   Please note that times displayed based on local time zone and are from time of writing this report.   Click HERE to access the full HFM Economic calendar.   Want to learn to trade and analyse the markets? Join our webinars and get analysis and trading ideas combined with better understanding of how markets work. Click HERE to register for FREE!   Click HERE to READ more Market news. Andria Pichidi HFMarkets Disclaimer: This material is provided as a general marketing communication for information purposes only and does not constitute an independent investment research. Nothing in this communication contains, or should be considered as containing, an investment advice or an investment recommendation or a solicitation for the purpose of buying or selling of any financial instrument. All information provided is gathered from reputable sources and any information containing an indication of past performance is not a guarantee or reliable indicator of future performance. Users acknowledge that any investment in FX and CFDs products is characterized by a certain degree of uncertainty and that any investment of this nature involves a high level of risk for which the users are solely responsible and liable. We assume no liability for any loss arising from any investment made based on the information provided in this communication. This communication must not be reproduced or further distributed without our prior written permission.
    • A few trending stocks at support BAM MNKD RBBN at https://stockconsultant.com/?MNKD
    • BMBL Bumble stock watch, pull back to 7.94 support area with high trade quality at https://stockconsultant.com/?BMBL
    • LUMN Lumen Technologies stock watch, pull back to 7.43 support area with bullish indicators at https://stockconsultant.com/?LUMN
×
×
  • Create New...

Important Information

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