Algorithmic and Mechanical Forex Strategies | OneStepRemoved

  • Articles
  • Sophisticated Web Sites
  • Automated Trading
  • Testimonials
  • Contact

3 Basic Applications of Moving Averages

February 25, 2014 by Andrew Selby Leave a Comment

As quantitative traders, we design our strategies to make trading decisions based on certain signals. These signals can be as simple, or as complex as we desire.

One of the most basic types of signals that a quantitative strategy will implement is a moving average. While these signals are simple to understand and widely utilized, it is surprising how effective they can be.

moving averages

Whether you use them as trade signals, trend filters, or as parts of other indicators, moving averages are an essential part of quantitative trading.

A recent post on Forex Crunch discussed three ways to use moving averages to generate trade signals. While none of these methods is new to us, the post provided a good reminder that there are multiple ways to implement a moving average in our trading strategies. Each method has a different goal, but they can all contribute to a profitable trading system.

Crossover Entry/Exit Signals

This is the most common way that moving averages are utilized. We have covered plenty of strategies that use moving average to determine when to enter or exit a trade. This is the basis for many trend following strategies.

The basic concept is that when a faster moving average crosses above a slower moving average, an uptrend has begun and the strategy should take a long positions. Then, when the faster moving average crosses back below the slower moving average, the uptrend has ended and the strategy should exit its position and possibly establish a short position.

One evolution of this strategy is to include a third moving average somewhere between the fast and slow moving averages. This middle moving average will allow your strategy to exit quicker, hopefully preventing giving back profits.

Trend Filters

Another popular application of moving averages is to use a long term moving average as a trend filter for a strategy that uses some other criteria for entries and exits. This can be seen quite often in the mean reversion strategies developed by Larry Connors and Cesar Alvarez.

One simple example of this would be a mean reversion system that only wants to trade short-term dips in the midst of a long-term uptrend. The strategy could use a 200-day moving average to determine the overall trend. Then, if the overall trend is up, it might use a different indicator, like RSI, to identify short-term oversold conditions.

Smoothing Other Indicators

Moving averages are also used in many different indicators in order to smooth out the data signals. Averaging the signals that an indicator produces enables a trader to eliminate some of the noise to get a clearer picture of what is actually happening in a market.

Two great examples of other indicators that utilize moving averages are the Stochastic Oscillator and the MACD Indicator. The Stochastic Oscillator uses the %K line, which is simply a moving average of the %D line, as an entry/exit signal. The MACD Indicator is actually based completely on moving averages.

 

Filed Under: Trading strategy ideas Tagged With: MACD, moving averages, Stochastic, trend filter

Three Indicators To Help Your Strategy Time Trades Better

January 28, 2014 by Andrew Selby 1 Comment

One of the first suggestions that is usually made when looking to improve a strategy is to add a trend filter of some sort. One of the most common trend filters is a long term simple moving average (SMA), but that isn’t the only option to consider.

There are a wide variety of market timing trend filters, and some may use a completely different type of analysis from your basic strategy. It is up to you to determine, through backtesting, which one is the best fit for your system.

In his article for Seeking Alpha, author Fred Piard compared three different market timing indicators that could all be used as trend filters. What was interesting about his piece was that one of the indicators was based on technical analysis, one was based on fundamental analysis, and the third was based on macro-economic factors. This provided a wide range of options, and all of them performed better in backtesting than a standard buy and hold approach.

timing trades

Using a simple timing indicator as a trend filter is a great way to increase profits and decrease risk.

Fred backtested each of these three indicators on SPY during the 15 year period from January 2, 1999 through January 17, 2014. During that time, a buy and hold benchmark would have produced an annual return of 4.6% with a maximum drawdown of 55.4%.

The Technical Trend Filter

The technical market timing indicator that Fred suggests is the classic golden cross indicator that makes use of the 50-unit and 200-unit SMAs. The indicator is bullish when the 50-unit SMA is above or equal to the 200-unit SMA, and bullish when the 50-unit SMA is below the 200-unit SMA.

Holding long positions in SPY when this technical indicator was bullish during the backtesting period would have produced an average annual return of 8.1% with a maximum drawdown of 17.0%. That is almost double the annual return of the benchmark with less than one third the drawdown.

Taking a short position when this indicator turned bearish during the backtesting period would have produced another 1.2% average annual return with a maximum drawdown of 47%.

The Fundamental Trend Filter

The fundamental market timing indicator that Fred discusses is based on the S&P 500 current year EPS estimate. When that estimate is above or equal to its value from three months prior, the indicator is bullish. When the estimate is below its value from three months prior, the indicator is bearish.

Holding a long position when this fundamental indicator was bullish over the last 15 years would have produced an annual return of 9.2% with a maximum drawdown of 20.2%. Once again we are going to dramatically outperform the benchmark. Compared to the technical trend filter, we can see that we are giving up some maximum drawdown in order to increase the annual return.

Taking a short position when this indicator was bearish over the backtesting period would have produced an annual average return of 1.9% with a maximum drawdown of 41.4%.

The Economic Trend Filter

The economic based market timing indicator that Fred tests uses the U.S. unemployment rate. This indicator is bullish when the unemployment rate is below or equal to its value from three months prior. It is bearish when it is above where it was three months ago.

Holding a long position during periods when this indicator was bullish over the past 15 years would have produced an average annual return of 8.84% with a maximum drawdown of 27.2%. While this indicator outperforms the benchmarks, it would be more risky than the other two indicators because of its maximum drawdown.

Taking a short position when this indicator was bearish during the backtesting period would have produced an average annual return of 3.2% with a maximum drawdown of 45.5%.

Filed Under: Test your concepts historically, Trading strategy ideas Tagged With: market timing, timing indicator, trend filter

The New Yearly High System

September 25, 2013 by Andrew Selby 2 Comments

At the root of most trend following systems is the idea that you want to be long markets that are moving higher or short markets that are moving lower. One of the simplest and most popular ways to identify markets that are trending up or down is to look for ones that are making new 52-week highs or lows. This simple signal can be used as the root of a very simple and easy to follow trend following system.

About The System

In his book, Unholy Grails, author and trader Nick Radge discusses a number of different systems providing set rules and backtesting results. One of the first systems he describes is based on the concept that stocks making new yearly highs are likely to continue higher, and stocks making new yearly lows are likely to continue trending lower. This is one of the core concepts behind most systematic trend following strategies.

Radge points out that a system that is based on new yearly highs and lows is very user-friendly because most financial resources publish data for stocks making new 52-week highs and lows. This means that we could literally trade this system manually without any trading software.

One way that Radge simplifies the system is by assuming that there are approximately 250 trading days in a year. Therefore, any stock making a new 250-day high or low will also be making a new yearly high or low. This means we can treat this system as a very simple 250-day breakout system.

This system establishes a long position on the open the day after a stock makes a new 250-day high and then exits that position on the open of the day after the stock makes a new 52-week low. These 250-day highs and lows are easy to monitor using a price channels overlay, which is available in most charting packages. The solid yellow lines on the chart below represent the 250-day high and low prices.

yearly high and low in BND

BND forms a new 250 day low

Trading Rules

Enter Long When:

  • Price Closes At New 250-Day High

Exit Long When:

  • Price Closes At New 250-Day Low

Backtesting Data

In order to backtest this system, Radge used the stocks in the All Ordinaries Index, which is the most popular stock market index in Australia. He compares his results to the All Ordinaries Accumulation Index, which is a benchmark that represents a buy and hold approach on the Australian equities markets.

His testing period ran from January 1, 1997 through Jun 30, 2011. The account started with $100,000 and sized positions at 5% of the account. Commissions and dividends were also taken into account.

Trading the New Yearly High System over those 14 years would have produced a total of 170 trades. The Compound Annual Growth Rate (CAGR) would have been an impressive 18.21%, more than doubling the 8.78% CAGR of the benchmark buy and hold account. The system was profitable on 53.3% of its trades and posted a Sharpe Ratio of 0.395.

The glaring negative of the backtesting results would be that the New Yearly High System posted a maximum drawdown of over 50%.

System Analysis

One of the most common things you will hear about system development is that traders place far too much emphasis on entry and exit signals. Conversely, there is generally not enough emphasis placed on risk management and position sizing. This system is a great example for those philosophies because its entry and exit signals appear to work just fine, but its 50% drawdown indicates that it doesn’t do a good enough job protecting its profits.

The New Yearly Highs System has a significant strength in that it works. Its returns actually beat a buy and hold approach by more than double. However, its weakness needs to be addressed, because it would be an absolutely nightmare to attempt to stick to the system while sitting through a 50% drawdown.

Improving The System

Trend Filter

The first thing I would do to improve this system is introduce a trend filter using the 200 day simple moving average (SMA). This filter would simply require that the general market be in an uptrend in order for the system to enter a long position in any single stock. This would ensure that the system was not taking long positions in stocks that were trying to trend higher against a downtrending general market. We should have more overall success if we consistently trade with the trend of the overall market.

Trailing Stop

Another condition I would add to the system would be an ATR-based trailing stop that would ensure that we locked in profit from any profitable trades. It would also minimize our losses on losing trades. Adding this stop might cut down the overall returns a bit by cutting short trades that would have eventually turned profitable, but the downside protection would likely be worth that sacrifice.

Changing the Universe

One of the things that Radge suggests is trading the system exclusively on the market index as opposed to individual stocks. He suggests that this would cut down on volatility and then proves that concept with backtesting results. This idea lowered the CAGR to 13.92%, but also cut the maximum drawdown down to 36.03%.

Keeping with the line of thinking that trading the system on indexes would reduce volatility, I would be curious to test the system trading across multiple indexes or ETFs. It would be interesting to see how the system performed on the ETFs traded by the Ivy Ten System or the markets recommended by Andreas Clenow in Following The Trend.

Filed Under: Trading strategy ideas Tagged With: All Ordinaries, drawdown, NIck Radge, trailing stop, trend filter, yearly high

FREE trading strategies by email

Trending

Sorry. No data so far.

Archives

  • Dominari
  • How does the forex market work?
  • Indicators
  • MetaTrader Tips
  • MQL (for nerds)
  • NinjaTrader Tips
  • Pilum
  • QB Pro
  • Stop losing money
  • Test your concepts historically
  • Trading strategy ideas
  • Uncategorized
  • What's happening in the current markets?

Translation


Free Trading Strategies

Privacy PolicyRisk Disclosure

Copyright © 2023 OneStepRemoved.com, Inc. All Rights Reserved.