This article requires a subscription to view the full text. If you have a subscription you may use the login form below to view the article. Access to this article can also be purchased.

## Abstract

Trend rules are widely used to infer whether financial markets show upward or downward movement. By taking suitable long or short positions, one can profit from a continuation of these movements. Conventionally, trend rules are based on moving averages (MAs) of prices rather than returns, which obscures how much weight is assigned to different historical time periods. In this article, the authors show how to uncover the underlying historical return weights of price MAs and combinations of price MAs. This leads to surprising and useful insights about popular trend rules—for example, that some trend rules have inverted information decay (i.e., distant returns have more weight than recent ones) or hidden mean-reversion patterns. This opens the possibility for improving the trend rule by analyzing the added value of the mean-reversion segment. Because of the increased transparency and flexibility, they advocate designing trend rules in terms of returns instead of prices.

Trend rules are widely used to time financial markets. When historical price patterns persist to some extent into the future, they can be exploited to predict the future direction of prices. Trend rules have their origin in technical analysis^{1} and are based on technical indicators computed from historical prices. Undoubtedly the most popular technical indicators are moving averages (MAs) and combinations of MAs. The simplest trend rule uses one *N*-period MA and prescribes taking a long (short) position when the current price is above (below) this MA, thus capitalizing on the persistence of the trend. More complex trend rules use combinations of long-term and short-term MAs or even multiple hierarchically stacked MAs designed to incorporate the acceleration or deceleration of a trend.

It is general practice to define MAs in terms of price levels.^{2} This is surprising. First, trend (or time-series momentum) implies a degree of persistence in price movements and hence focuses on positive or negative changes in prices, rather than price levels. Indeed, a trend implies some dependence structure in the time series of returns.^{3}

Second, using some combination of past price levels (as is done when using MAs of prices) obscures the weighting scheme assigned to individual historical periods. After all, a price level cumulates returns over multiple time periods, whereas a return is unambiguously linked to a single time period. Using trend rules defined in terms of returns therefore allows one to acknowledge the differences in importance or weight given to historical time periods. This is important because there will be some degree of information decay, rendering more distant history less relevant than the more recent past. In addition, it is important to know whether some implied historical weights are positive or negative, thus allowing for the distinction between trend persistence and mean reversion.

The contribution of this article is that we show how to uncover the return weights implied by conventional price MAs, both in a theoretical and an empirical fashion. The analysis of these return weights reveals surprising and useful aspects of trend rules. All of these aspects are hidden by their specifications in terms of prices but are revealed by the analysis of return weights. An increased understanding of these trend rules in turn allows one to further improve these rules. For example, we analyze trend rules combining long and short price MAs and show these composite rules may have humps (i.e., the weight of the most recent returns start low and increase up to a maximum, after which the weights decline again). This is difficult to reconcile with the idea of information decay.

As a second example, consider the popular moving-average convergence divergence (MACD) rule, which turns out not only to have a hump-shaped weighting scheme but also as much negative weight as positive weight. Because negative weights imply a mean-reversion rule (positive past returns imply negative signals), we show that the MACD rule is in fact just as much a trend rule as it is a mean-reversion rule. Using the return weights, it is possible to separate the performances of the trend and the mean-reversion segment and to improve the MACD rule by assigning different weights to these parts or even by completely removing nonperforming parts.

Our study is closely related to the recent articles by Levine and Pedersen [2016] and Zakamulin [2016]. They independently showed how trend rules, defined in terms of prices, can be translated into particular weighting schemes for returns or price changes. This allowed them to reveal that many trend rules that appear to be different are in fact very closely related due to their similar return weights. Our focus, instead, is on uncovering hidden phenomena and ramifications for designing better trend rules.

The remainder of this article is organized as follows. In the next section, we define trend rules expressed as a combination of long and short price MAs, and in the third section, we derive the return-weighting schemes of such rules. In the fourth section, we analyze several weighting schemes. We show the presence of a hump in a combination of a single long and short price MAs and extend this to combinations of multiple long and short price MAs. We demonstrate that trend rules with a skip period (in which the long price MA starts after the short MA) are in fact rescaled versions of ordinary combinations of long and short price MAs. We show that the MACD rule also has a hump and that it conceals as much mean reversion as trend. In the fifth section, we show how we can empirically uncover the weighting scheme underlying a (composite) trend rule in a single market from the resulting trend returns. The final section summarizes and concludes.

## PRICE MOVING AVERAGES

Consider a stock market index, a currency, or some other index series with historical log price series {*p*_{t}}.^{4} We measure time in periods of equal unit length (this can be days, weeks, or months). At time *t*, a simple price MA based on *N* time periods then takes the form

Hence, the time *t* price can be written as *MA*(1)_{t}.

Typical trend rules combine an MA over a short period with an MA over a longer period. A composite (*M*, *N*)-trend indicator then is computed as

with *M* < *N*. *M* = 1 is a special case, in which the current log price is compared to the MA of log prices over the past *N* periods.

When the short moving average increases above or drops below the long moving average, there is a crossover. When the trend indicator switches from positive to negative, this is interpreted as a sign that the momentum of the market may have become negative. Shorting the market will be profitable when the prediction indeed becomes true. As an alternative to these directional bets, proportional bets can be taken, in which the size of the position not only depends on the sign of the trend indicator but also on its specific value (strength of trend).^{5}

## ANALYZING MAs DEFINED IN PRICES

In this section, we derive the return-weighting scheme of a *trend* (*M*, *N*) rule. The derivation can easily be extended to any linear combination of price levels; any linear combination of price levels can be translated into a linear combination of returns and vice versa. The derivation for combinations of price MAs, however, is in our view the simplest and clearest derivation, so the general case is deferred to the Appendix.

To uncover the return-weighting scheme, we express each past log price level as the difference between the current log price level and the sum of intermediate log price changes:

3where *r _{t}* =

*p*−

_{t}*p*

_{t}_{−1}is the log return over period

*t*. When applying Equation (3) to each price level comprising the

*MA*(

*N*) of Equation (1), we obtain the scheme as depicted in Exhibit 1.

Combining Equations (1) and (3) is equivalent to summing all the terms in Exhibit 1 and dividing by *N*. This yields the expression^{6}

Equation (4) shows that *MA*(*N*) represents the difference between the current log price level and a specific weighted sum of past returns.

When using Equation (4) for *MA*(*M*) and substituting this result in the definition of the composite (*M*, *N*)-trend indicator, we obtain

We conclude that the MA in log prices has a specific linear weighting scheme in terms of returns:

6where the weights are given by the following expression:

7In practice, such trend rules are often scaled by dividing by a long-term (e.g., 10 years) standard deviation to combine them with different time-series rules, be it trend or otherwise. When viewing this trend rule as a weighted sum of returns directly, it makes sense to normalize these weights rather than divide by a standard deviation. By doing so, the trend rule becomes a weighted average of past returns. In this case (see the Appendix), the weights become

A special case is the (1, *N*)-trend indicator:

where the last equality shows the normalized weights of the past returns.

## ANALYZING WEIGHTING SCHEMES

In this section, we analyze the weights of several trend rules in more detail: We consider *trend*(*M*, *N*) rules, combinations of multiple *trend*(*M*, *N*) rules, *trend*(*M*, *N*) rules with a skip period, and the MACD rule.

### Single *trend*(*M*, *N*) Rules

In this section, we show that *trend*(*M*, *N*) rules carry an implied belief in short-term mean reversion if they are compared with *trend*(1, *N*) rules.

In Exhibit 2, we display the weighting schemes of *trend*(*M*, *N*) rules, as given by Equation (7). The *trend*(1, *N*) rules display a linearly declining weight, which implies a linear discounting of past returns. The *trend*(*M*, *N*) rule with *M* > 1, however, shows a surprising hump in the weighting scheme: Returns of *M* periods ago have a higher weight than returns over the last period. Furthermore, from Equation (7), we see that

so the difference between using a *trend*(*M*, *N*) rule or a *trend*(1, *N*) rule is given by −*trend*(1, *M*). Trend rules with negative weights are, in fact, mean-reversion rules (i.e., positive past returns imply negative future returns and vice versa). As a result, if one faces a choice between a *trend*(*M*, *N*) and a *trend*(1, *N*), choosing the *trend*(*M*, *N*) rule implies belief in short-term mean reversion.

### Combinations of Multiple *trend*(*M*, *N*) Rules

When designing trend rules in terms of price levels, it makes sense to combine multiple trend rules, allowing an investor to benefit from diversification. Looking at the weighting schemes of the individual trend rules, however, reveals additional insights in such cases: Combining multiple trend rules can lead to weighting schemes with inflection points and multiple humps.

First, we combine the weighting scheme of two *trend*(1, *N*) rules. The resulting trend rule is the average of the two underlying trend rules, and the weighting scheme of the resulting trend rule is the average of the underlying weighting schemes. In practice, such trend rules are often combined after dividing by a long-term standard deviation (e.g., 10 years) to make their volatilities comparable. However, this does not materially affect the form of the weighting scheme or our conclusions.

In Exhibit 3, we show the weighting scheme of the combination of a fast (1, 40) and a slow (1, 250) trend rule. The weighting scheme reveals a surprising inflection point at 40. Combining more trend rules introduces more inflection points. Instead of such discrete cutoff points, it might be more desirable to choose a priori a functional form that reflects a more gradual information decay, such as an exponential function.

Moreover, in Exhibit 4, we show the weighting scheme of a fast (5, 40) and a slow (50, 250) trend rule. As shown before, these trend rules have a hump-shaped weighting scheme. Exhibit 4 clearly shows that their combination even has multiple humps. Although the combination of multiple trend rules seems perfectly reasonable for price series, an analysis of the weighting scheme reveals that the weight of returns increases between one and five periods ago, then decreases and increases again between 40 and 50 periods ago.

*Trend*(*M*, *N*) with a Skip Period

Because the short and long MA in a *trend*(*M*, *N*) rule share an overlap of the first *M* periods, a skip period is sometimes used in the calculation of the trend rule. With a skip period, the MA of the previous *M* periods is compared with the MA of the *N* periods before that (i.e., from *N* + *M* periods ago up to *M* periods ago). In this section, we show that adding a skip period is equivalent to prolonging the longest MA from *N* to *N* + *M*, apart from a scaling factor:

A trend rule with a skip period is defined as follows:

11For such rules, we can derive the weighting scheme in a way similar to how we derived Equation (7). We obtain

12with

13For the first past *M* periods, the weight increases linearly; after that, it decreases linearly. Indeed, this weighting scheme shows remarkable resemblance to the hump-shaped weighting scheme of the *trend*(*M*, *N* + *M*) rule. We proceed by rewriting the weights of the *trend*(*M*, *N* + *M*) rule in Equation (7):

which is indeed identical to Equation (13), apart from the scaling factor.

## MACD

Another popular combination of trend rules is the MACD rule, proposed by Appel [2005] in the 1970s. The MACD rule comprises a combination of three exponentially weighted moving averages (EWMAs). In this section, we analyze the weighting scheme of the MACD rule in more detail. We uncover the functional form of the weighting scheme and show that the MACD rule is just as much mean reversion as it is trend: The sum of negative weights is equal to the sum of positive weights.

The MACD rule combines three EWMAs of a price series. First, a slow and a fast EWMA of a price series are computed. Next, the MACD is defined as the difference between these EWMAs:

15where λ_{s} and λ_{f} are the persistence parameters of the slow and fast EWMA, respectively, satisfying 0 < λ* ≤ 1. An *N*-period EWMA translates into a persistence of (see Appel [2005]). Finally, the signal at time *t*, denoted by *S*_{t}, is an EWMA of the MACD (with a third persistence parameter λ), minus the MACD itself:

In the Appendix, we show that the signal of the MACD rule can also be written as a weighted sum of returns:

17These weights are plotted in Exhibit 5. Clearly, as in the case of multiple trend rules, more distant returns have higher weights than the most recent returns. Although this may be perfectly desirable, this feature of the MACD rule is hidden by the definition in terms of EWMA price rules but revealed by its return-weighting scheme.

Furthermore, Exhibit 5 illustrates that the weights become negative at some point. In fact, in the Appendix, we show that the sum of positive weights is equal to the sum of negative weights. Because negative weights indicate mean reversion (positive past returns imply negative signals), the MACD rule—although typically presented as a trend rule—is just as much a mean-reversion rule as it is a trend rule.

## REVERSE ENGINEERING

In addition to revealing information about trend rules, expressing trend rules as weighted sums of returns also allows one to reverse engineer trend returns. That is, from the returns of a trend rule, we can—with great confidence—discover the trend rule that was used to generate the returns. The latter can even be done after a portfolio implementation rule is taken into account and after normalizing z-scores are taken, as is common in a multifactor framework.^{7} Our methodology is similar to the returns-based style analysis introduced by Sharpe [1988].

We illustrate this reverse engineering for an *MA*(5, 45) rule applied to daily S&P 500 futures data, obtained from Bloomberg,^{8} starting on April 21, 1982, and ending on May 31, 2015 (comprising 8,900 days). We take a z-score of the *MA*(5, 45) rule using the 1,300-day average and standard deviation. We further define a signal that is equal to 0 if the trend score is less than 0.3 in absolute value and equal to the sign of the score otherwise. The latter rule serves as a simple implementation rule that translates the scores into long, short, and neutral positions. Finally, we multiply the scores and the signals by the futures return of the next day to obtain the return series of the trend rule, *r _{score}*

_{,t}and

*r*

_{signal}

_{,t}, respectively.

Given only these trend returns and the futures returns, we uncover the underlying trend rule by running the following regression for scores as well as signals:

18Here, *r _{t}* is the market futures return of day

*t*and

*y*is either the observed score

_{t}*r*

_{scores}_{,t}/

*r*or the observed signal

_{t}*r*

_{signal}_{,t}/

*r*

_{t}at time

*t*.

^{9}The regression coefficients represent the empirical weights of the trend strategy.

We obtain estimates for the coefficients in Equation (18) through ordinary least squares regression with *T* = 100 for both the score and signal returns. The empirical weighting scheme is plotted in Exhibit 6, along with the theoretical weights of a *trend*(5, 45) rule. The empirical weighting scheme matches the theoretical weights quite closely, especially for the scores. For the signals, we see some noise around the theoretical weights, but the empirical weights still match the theoretical weights quite well.^{10}

The more nonlinear the transformations applied to the trend scores, the less accurate the implied weights will be. The simple implementation rule with neutral positions used in this section is also a nonlinear transformation and already reduces the *R*^{2} of the regression from 91% for score returns to 65% for signal returns. More complex nonlinear transformations will further reduce the regression fit and hence the confidence we have in the implied weights. Yet, even with the implementation rule used in this section, the underlying trend rule is convincingly identified. Applying linear transformations, in particular taking moving averages of moving averages, will not affect the accuracy of the implied weights because the regression itself is also linear.

In practice, trend rules are often combined. In such a case, the framework described in this section allows one to reverse-engineer the combination of these rules, as long as that combination is (roughly) linear. In addition, trends on multiple markets are often combined. In such a case, one needs to regress the returns of the strategy on all market returns. Clearly, this analysis becomes much more data intensive and may require one to deal with statistical issues such as multicollinearity. Such an analysis is beyond the scope of the current article; our aim is to show that, given single-strategy returns on a single market, the return weights of the trend strategy can be uncovered.

## SUMMARY AND CONCLUSIONS

We showed how to uncover the return-weighting schemes implied by conventional price MAs. Because returns are unambiguously linked to separate time periods, these weighting schemes offer direct insight into the weight given to past time periods. We analyzed the weighting schemes of several popular trend rules: The combination of long and short price MAs induces a hump-shaped weighting scheme, giving distant returns more weight than recent returns. Multiple combinations stacked together even have weighting schemes with multiple humps. Furthermore, we show that the impact of adding a skip period to a trend rule is limited to just a scaling factor. Finally, we analyzed the weighting scheme of the popular MACD trend rule, revealing not only that it has a hump-shaped weighting scheme but also that this rule is as much a trend rule as it is a mean-reversion rule.

All these phenomena are hidden by definitions in terms of prices but are revealed by the analysis of return weights. An increased understanding of these trend rules allows one to improve them. For example, using the return weights, it is possible to separately analyze the trend and mean-reversion parts of the MACD rule, and it allows one to assess the impact of the implied mean reversion in combinations of multiple MA rules. If the mean-reversion part contributes negatively to the performance of the trend rule, one can keep only the positive return weights, leading to an improved trend rule without the mean-reversion part.

Finally, we supplemented our theoretical analyses by showing how to empirically uncover the underlying weighting scheme of a trend strategy applied to a single market. The practical implication of this analysis is that given only trend returns in a single market, we can determine the weighting scheme that was used to construct the trend signals.

Because of the greater transparency of trend rules defined in terms of returns, we advocate designing trend rules in terms of returns rather than prices. After all, by directly designing a trend in terms of returns, one cannot be surprised by (mean-reverting) phenomena that are hidden by price definitions. For example, although combining multiple trend rules adds diversification, it also introduces non-monotonic weighting schemes with multiple humps. Similar trend rules can be designed by choosing an a priori return-weighting scheme with more gradual information decay, such as an exponential function, and handing the investor control over whether or not to allow for humps. In addition, return-weighting schemes allow for evaluating the contribution of trending and mean-reverting patterns to the performance of a trend rule. Finally, designing a trend rule in terms of returns allows one to better adjust the trend rule to positive and negative autocorrelation patterns in the data. This, however, will be left as a topic for further research.

## APPENDIX

In this Appendix, we express *MA*(*N*, *M*) in terms of normalized weights, show how any linear combination of price levels can be expressed as a weighted sum of returns, and derive the weighting scheme for the MACD rule.

### Rewriting *Trend(M, N)* in Terms of Normalized Weights

Specifically, the sum of the return weights in Equation (7) is

A-1Dividing the return weights in Equation (7) by this expression gives the normalized weights.

### Return Weights of General Price-Trend Rules

We derive the return-weighting scheme of a general price-trend rule. Let

A-2be a price-trend rule. We have

A-3Furthermore, let . This assumption is not restrictive in practice because a nonzero sum here implies that the signal of the trend level depends on the current price; that is, given the same returns, the trend rule has different signals based on whether the price level is at 10 or 100. By interchanging the double sum, we then find

A-4Conversely, given return-trend weights *w _{i}*, it follows from this definition that the corresponding price-trend weights are given by

This shows that price-trend weights and return-trend weights are unambiguously linked: Given any price trend–weighting scheme, we can obtain return weights and vice versa.

### The Return-Weighting Scheme of the MACD Rule

We now derive the return-weighting scheme of the MACD rule. It comprises three EWMAs of a price series and is computed in three steps.

In the first step, we calculate the difference between a fast and a slow price EWMA. We define the value of the slow EWMA at time *t* as *m _{s}*

_{,t}and likewise define the fast EWMA at time

*t*as

*m*

_{f}_{,t}. Their persistence parameters are λ

_{s}and λ

_{f}, respectively.

^{11}We assume the (log) price index is zero at time 0 so that

For the slow EWMA, we have

A-7Interchanging the double sum yields

A-8Likewise, we find that . The MACD at time *t* is defined as the difference between *m _{f}*

_{,t}and

*m*

_{s}

_{,t}:

In the second step, we calculate the EWMA of the MACD itself (with a third persistence parameter, λ). The EWMA of the MACD is

A-10so we proceed by rewriting EWMA(*m _{s}*

_{,t}, λ):

Here, the last equality follows from substituting *i* = *t* − *u* + 1. Likewise, we have

The EWMA of the MACD is thus given by

A-13In the third and final step, we calculate the MACD signal at time *t*, denoted by *S*_{t}, as the difference between the MACD and the EWMA of the MACD:

Using this weighting scheme, we can also show that the MACD rule incorporates mean reversion as much as it incorporates trend. In particular, the sum of positive weights is equal to the sum of negative weights. We prove this by showing that the total sum of weights is equal to zero. Evaluating all sums in Equation A-14 and rewriting immediately yields

A-15Thus, the sums of positive and negative weights are indeed the same.

## ENDNOTES

We thank Alexander de Roode for helpful discussions and feedback on a previous version of this article. All remaining errors are our own. Views expressed in this article are the authors’ own and do not necessarily reflect those of Robeco.

↵

^{1}In fact, trend rules are the only “objectifiable” technical analysis rules that can be subjected to statistical testing (as compared to “fuzzy” head-and-shoulder patterns, support lines, and other graphical patterns attributed to historical price moves). See, for example, Brock, Lakonishok, and LeBaron [1992]; Lo and MacKinlay [1999]; or, more recently, Zakamulin [2014].↵

^{2}An exception is Okunev and White [2002], who analyzed trend rules in foreign exchange markets and used MAs defined in terms of returns.↵

^{3}In addition, price-level series are generally integrated of order one and hence have undesirable statistical properties. It is therefore not without reason that financial econometrics focuses on relative first differences in prices or differences in log prices (viz. returns).↵

^{4}We use log prices because a change in log prices does not depend on the initial price level. Hence, a change in log prices is equivalent to a return. After all, a change of 10 index points when the index is 100 is quite different from a 10-point change when the index is 1,000. In practice, trend rules are sometimes defined on price levels and later scaled by dividing by an average price level. This does not materially affect the weighting scheme or the conclusions of this article but unnecessarily complicates the theoretical derivation.↵

^{5}For the expected return, standard deviation, and information ratio of directional versus proportional market timing strategies, we refer to Hallerbach [2014].↵

^{6}An entirely analytic and less intuitive derivation follows from inserting Equation (3) into Equation (1) and interchanging the double sum.↵

^{7}The z-score of a score is computed as the initial score minus its average, divided by its standard deviation. The z-transformation makes scores from different sources mutually comparable and thus allows summing or averaging different scores into an overall score.↵

^{8}Because of the finite life and zero investment features of futures contracts, the data have to be adjusted for gaps and level corrected. Akin to Baltas [2015], we use the generic series provided by Bloomberg, which always uses the front contract.↵

^{9}Because this is a controlled experiment, we know that the returns of the trend series are a multiple of the returns of the market. In a noncontrolled experiment, one would need to make sure that*r*_{t}is not close to 0 because the empirical weights would blow up.↵

^{10}When strategy returns are only available over a shorter period, we must reduce the number of regressors to safeguard estimation accuracy. One obvious way to do this is by reducing the lookback period*T*, thus assuming a shorter trend rule. The size of the more distant weights will reveal whether this assumption is warranted. An alternative is to consider a lag structure of the regressors that is finely spaced for recent lags (e.g., daily over the past month) and more widely spaced for more distant lags (e.g., weekly). The intermediate weights can then be found by linear interpolation between the estimated weights.↵

^{11}Although the MACD algorithm does not prescribe whether to take prices or log prices, we use log prices for the ease of derivation. Using regular prices does not significantly affect the weights but does lead to slight inaccuracies as a result of multiplying returns rather than adding them.

- © 2017 Pageant Media Ltd