**Note:** *James Picerno of The Capital Spectator recently did an interesting piece evaluating the Self-Similarity Metric and provides some R code which is valuable for many of our readers. *

The principle of parsimony relates to being frugal with resources such as money or the use of computing time. It is closely tied to the principles of simplicity, elegance and efficiency. It also complements the philosophical theory of Occam’s Razor which states that the simplest explanation with the fewest assumptions is often closest to the truth. Whether doing statistical modelling or building trading systems, it would be wise to respect the power of this principle. **Parsimonious models or trading systems are often robust, while overly complex models with too many assumptions are not.** The difficulty is in telling the difference- which is not obvious even to a talented and experienced developer. The ability to distinguish between parsimony and excess complexity is virtually invisible to almost everyone else.

The backtest is the problem and great distractor in the quest for parsimony. It is like a picture of a beautiful woman that is scantily clothed beside a paragraph of important text– no one is interested in the fine print. A beautiful backtest is admittedly just as satisfying to look at (perhaps even more so for quants!) and can blind us from the details that got us to the end point. And while we all appreciate some good “chart porn”, there are some important questions to consider: What universe did we select and why? Why did we omit certain assets or choose certain parameters over others? Why did we choose one indicator or variable over another-and how do we know it is superior? Why do we trade at a certain rebalancing frequency versus another and is this relevant to the model? Most importantly is: **Can I create a trading system with similar results with far fewer assumptions and with less computational power? **That should be your goal- to achieve the maximum results with the least number of assumptions and resource usage.

For example, I am well aware than the Minimum Correlation Algorithm does not mathematically optimize the correlation matrix or find the most diversified portfolio. The Minimum Variance Algorithm does not minimize variance either relative to a true MVP solution. But they both use an intuitive and simple method that meets or often exceeds the results of the more complex solutions with less resources, and hence can be considered parsimonious.** **They are also less dependent on estimates for optimization inputs. Such systems are more likely to work in the uncertain and messy world that we actually live in. Cooking is a hobby of mine, and more recently I have strived to achieve the most with the least, and ensuring that all of my marginal choices of ingredients or differences in traditional technique are actually adding value. There is no point sounding fancy by adding exotic ingredients or using fancy techniques if they don’t change the taste for the better. These give the illusion of expertise to the unsophisticated, but to top chefs judging these dishes on FoodTV they only serve to highlight their deficiencies as cooks. **My advice is to work with things that you can understand or intuitively grasp and be very careful when trying newer and more complex methodologies**. Master what you can with the tools you have at your disposal instead of reaching for latest and greatest new toy. This may sound strange coming from a blog that was built around offering new ideas and concepts- but rest assured this is some of the best advice you will ever receive.

All of the questions I posed above relating to trading systems are quite material, and many cannot be answered quantitatively. Unfortunately for the quantitatively inclined, the principles of good logic often get lost while decoding proofs, cleaning data, or debugging computer code. Furthermore, the elegance of complex math is like comfort food for those that are highly intelligent and it is easy to forget that the assumptions of these models are a far cry from describing reality. Even for the more experienced developers that are aware of these problems, they may arrive at the wrong approach to system development. **The solution is not to avoid making ANY decisions or assumptions (although relying less on specific parameters or universes is desirable for example), but rather to make sensible choices with few assumptions. Another alternative is to build a methodology that directly makes choices quantitatively to create a parsimonious model. Both methods have their strengths and weaknesses. **

At the end of the day, there is no point making something more complicated than it needs to be unless the benefits are material. The same is true for the length of time/complexity of the run for the computer program that runs the trading. My brother is a professional hiker and has traversed extreme mountain terrain. Unlike most amateurs, he does not pack everything under the sun that might be useful for his trip. Instead he focuses only on the essentials and on minimizing weight. **More importantly, he focuses on planning for what can go wrong and makes his choice of gear and specific hiking route accordingly**. The black and white realities of survival bring these questions to the forefront. In contrast the more comfortable and forgiving world of offices and computers make trading system decisions seem almost like a video game. Rest assured, it is not…..

]]>

I have to say that one of the most rewarding aspects of this blog has been my interaction with readers (and fellow bloggers) at various levels. I have developed several relationships over the years, and some of these developed into new business opportunities. Many years ago while actively running CSS Analytics, I was fortunate to work with a core group of very talented and dedicated people. It has been nice to see that many of these individuals have become quite successful in the quant world. One of the original members of that talented group was David Abrams. We have spent a lot of time on system development over the years, and although we no longer actively collaborate we still manage to keep in touch. David reached out to me with some visuals and analysis on the chaos/stability self-similarity indicator I recently presented on the blog. I suggested that we post this for CSSA readers, and he was kind enough to agree to share.

**Dave Abrams is Director of Quantitative Strategies at Wilbanks, Smith and Thomas Asset Management (www.wstam.com) in Norfolk, VA, where they design risk managed fund models and S&P indices (about 400M of the firm’s 2.5B in AUM is quant). He was formerly part of a group doing quant research at CSS Analytics.**

**Visualizing The Chaos Stability Indicator **

It is useful to visualize DV’s new self-similarity regime method in a Tradestation chart. Here is the strategy and indicator using the default parameters (N = 10 day, 60 day average, 252 percent rank length). I transformed the indicator by subtracting 0.5 to center the values around 0 and displayed with a color coded histogram.

Here is what the Chaos Stability as a buy/sell indicator on the SPY looks like:

The indicator is currently in a new “sell” position as the value is below zero.

This perhaps reflects the more random and sideways market movement that we have had over the past few months. As with any indicator, this bearish signal is not perfect and in April through early July of 2014 the market made good upward progress despite the chaos stability values being mired deep in the red. It is useful to look at some other charts to get a sense of when the buy and sell signals occur.

It is hard to discern what is going on without careful inspection, but it seems as if the chaos/stability indicator flashes buy signals at swing lows- where the market is moving persistently downward or in persistent bull moves upward out of corrections or at the top of established rallies. Sell signals tend to occur near market tops where things get choppy or in areas of congestion where the market is moving sideways within its long-term trend. Since persistency occurs both in up and down moves, signals are uncorrelated or even negatively correlated to a trend-following strategy as highlighted in the original post. This is important to those looking to diversify a trend strategy on a single asset.

**Smoothed Chaos Stability Metric**

One of the challenges I noticed when looking at the charts was that the indicator frequently switched from buy to sell- especially as the value hovered close to zero. Smoothing seemed to be a logical approach to reduce some of the whipsaw trades and reduce turnover. To address this issue, I applied John Ehler’s Super Smoother method (http://traders.com/Documentation/FEEDbk_docs/2014/01/TradersTips.html) to to the Chaos Stability measure. Notice the indicator below. This reduced the number of trades by 11% and the Profit Factor went up by 6 %.

**Walk Forward Analysis**

One of the challenges of new indicators is that they tend to promise a lot but fail to deliver in the real world. Often the reason this happens is because the examples presented by the developer are tuned to a specific set of parameters- in other words the indicator is over fit and is not robust. So is DV’s innovative new indicator just lucky or is it stable? One of the best ways to evaluate whether an indicator has any predictive power is to perform a walk forward test. An indicator with no predictive power will tend to fail using such tests. For this evaluation, I did a walk-forward test in Tradestation. This module continuously re-optimizes the parameters so that at each period of time we are using out-of-sample results. We can get greater confidence in the strategy if it performs well using walk-forward. The results are below :

Based on these criteria for evaluation, the DV Chaos/Stability indicator passes with flying colors. In addition to passing the walk-forward test the logic of indicator is also sound- which is an often overlooked but important qualitative assessment. In our quantitative research methodology we always apply a walk-forward analysis and qualitative assessment. The hypothetical equity curve from the walk-forward results showing each out-of-sample period over time are presented below.

Tradestation Walk Forward Analyzer Performance Graph. The results are hypothetical results and are NOT an indicator of future results and do NOT represent returns that any investor actually attained

Good quantitative research is a combination of different but stable ideas which either confirms each other or adds diversity to the overall model. I agree with Ray Dalio that 15 uncorrelated return streams is the holy grail of investing (

http://www.businessinsider.com/heres-the-most-genius-thing-ray-dalio-said-2011-9). DV’s chaos stability regime model could be a viable uncorrelated candidate.

Disclosure

The research discussion presented above is intended for discussion purposes only and is not intended as investment advice, recommendation of any particular investment strategy including any of the depicted models. There are inherent limitations of showing portfolio performance based on hypothetical & back-tested results. Unlike an actual record, hypothetical results cannot accurately reflect the effect of material economic or market factors on the price of the securities, and therefore, results may be over or under-stated due to the impact of these factors. Since hypothetical results do not represent actual trading and may not accurately reflect the impact of material economic and market factors, it is unknown what effect these factors might have had on the model depicted above. Past performance, whether based on hypothetical models or actual investment results, is not indicative of future performance.

]]>

The images above are the famous Sierpinski Triangle and the Koch Snowflake. These objects are “self-similar” and this means that examination at finer levels of resolution will reveal the same shape. Both are examples of “fractal” geometry, and are characteristic of many phenomena in the natural world such as mountains, crystals, and gases. Self-similar objects are associated with simplicity, redundancy and hence robustness. Self-dissimilar objects are associated with complexity and chaos. Several mathematicians (including Mandelbrot) have observed that markets are clearly non-gaussian or non-normal. Markets exhibit “fat-tails” and have a distribution that shares more in common with a Levy distribution than the normal distribution which is used frequently in quantitative finance. But the market does not have a constant distribution- at times the market behavior is fairly normal in character while at other times the market is wild and unpredictable. The question is how we can effectively determine which regime the market is in so that we can apply the appropriate trading strategies to mitigate risk.

The essence of self-similarity and complexity is to compare the whole to its component parts. For example lets take a square that is divided into four separate squares of equal size. The area of the larger square is equivalent to the sum of the areas of each of its component squares. The same of course is true of a one-dimensional line which is equivalent to the sum of its parts. One of the methods of identifying self-similarity in the stock market is to look at the range or the difference between the highs and the lows. We would expect that in a perfectly self-similar market the longer range would be equivalent to the sum of the ranges measured over a smaller interval. The more chaotic the market is, the greater the difference will be between these two measures. Such market conditions would be characterized by a large ratio between the sum of smaller ranges versus the longer measure of range. Essentially this relationship is called fractal dimension and is a measure of complexity. There are many different ways to measure this including using the Hurst exponent, but the problem I have always found in my own humble research is that the suggested thresholds defined by specific absolute values do not seem to reflect the information consistent with theory. I have often found that relative measures tend to be more robust and consistent- much the same way that the magnitude of past returns has less predictive value than the relative rank of past returns. Relative measures tend to be more stationary than absolute values. To compute this measure of self-similarity I use the intraday range (high minus low) versus a longer range window. Here is how it is calculated:

1) find the high minus the low for each day going back 10 days

2) take the sum of these values (sum of the pieces)

3) find the 10-day range by taking the 10-day maximum (including the highs) and subtracting out the 10-day minimum (whole range)

4) divide the sum of the pieces by the whole range- this is a basic measure of fractal dimension/complexity

5) take the 60-day average of the 10-day series of the complexity values- this is the quarterly “chaos/stability” metric

6) use either the 252-day normsdist of the z-score or the percentile ranking of the chaos/stability metric

7) values above .5 indicate that the market is in a “chaos” regime and is much less predictable and non-stationary, values below .5 indicate that the market is stable and much more predictable.

When the market is “stable” it is easier to apply effective quantitative trading systems. When the market is in “chaos” mode, it is not necessarily volatile- but rather it is too complex to use for standard measurement and calibration of basic linear prediction. Let’s look at how this measure performs over a long time period using the S&P500 as a test set. The high and low values are generally the same until about 1963 which is when we will begin this test. Here is how the market performed in both regimes over the last 50+ years:

The market performs quite poorly in “chaos” conditions, and seems to make all of its long-term returns in the “stable” regime. Note however that the volatility is not materially different between both regimes- this means that we are capturing something different than just high and low volatility market conditions. Furthermore the correlation between the chaos indicator signals and for example the basic trend signal of a 200-day moving average is -.116. This means that we are capturing something different than just the market trend as well. The indicator is meant to be used to define regimes rather than as a trading signal to go long or short, but clearly there are some interesting attributes worthy of further exploration and refinement.

]]>

]]>

In quantitative finance there is the concept of “Conditional Value at Risk” (CVaR) which is a calculation frequently used in risk management. The general idea is that you are trying to capture the expectation beyond a certain tail of the distribution. The CVaR is preferred to the value at risk because it more comprehensive than looking a just one value. Likewise, Percentile Channels are similar to value at risk in that context as well as traditional Donchian Channels which only look at one reference price. Perhaps a logical improvement would be like CVaR to use the average of the prices above a certain percentile threshold. This is more like calculating the **expected** upper or lower bound for prices. Furthermore to account for the fact that recent data is progressively more important than older data, we can weight such prices accordingly.In theory, the most important prices are at the extremes and should also be weighted as such. So Conditional Percentile Channels is simply a twist on Percentile Channels incorporating these two ideas. Here is how it would be calculated:

Basically you select a threshold like .75 and .25, and then you weight the prices that are above those thresholds according to both position in time (like a weighted moving average) and distance to max or min. This gives you a more accurate expected upper or lower bound for support and resistance (at least in theory). I know I am going to regret this, but using the same strategy ie- Percentile Channel Tactical Strategy in the last few posts- I substituted in the Conditional Percentile Channels using the same threshold of .75 and .25. All other parameters are identical. Here is how that looks:

Looks like a slight improvement over the original strategy in both returns and risk-adjusted returns. In general, I just like the concept better since it condenses more information about support/resistance than either Donchian Channels or Percentile Channels. It also represents a good complement to moving averages which capture central tendency rather than price movement at the extremes. So there you have it- yet another twist on using channels.

]]>

The table below compares the original strategy (channel rp) to other benchmarks including 1)ew- equal weight the assets in the portfolio 2)rp- risk parity using the assets in the portfolio and 3) channel ew: the percentile channel TAA strategy using equal weighting 4) QATAA- which is the application of Mebane Faber’s trend-following strategy cited in his now famous paper- A Quantitative Approach to Tactical Asset Allocation (in this case QATAA uses the same underlying assets and cash allocation as the percentile TAA strategy). Of course QATAA is one of the inspirations for the strategy framework and Meb always manages to publish interesting ideas on his World Beta blog. To avoid issues with different sources of extended data, **Systematic Investor begins the test in 2010 using the underlying ETF data** to show how the strategies have performed in the current bull market. If you are getting results in line with this test than you can feel comfortable that you have the details correct- if not you can use R and the code provided by Systematic Investor in the post.

After comparing results, Michael and I show an near identical match (I also get a sharpe of 1.42 and a CAGR of 8.93%) – a relief after all the commotion caused by the initial post (which was addressed in my now amusing rant over here). The original strategy is the best performer of the bunch since it applies multiple time frames as well as normalized bet sizing via risk parity (common for most trend-followers). As I have stated before, of the reasons I like the Percentile Channel approach is that the signals are likely to be slightly different from what most asset managers and investors are using.

]]>

In the last several posts, I introduced some different methods for channel strategies including Percentile Channels. A simple way to potentially improve (or at least take a different approach) to a donchian channel strategy is to use a different price input to generate trading signals. As stated in Error-Adjusted Momentum Redux, using any type of risk adjustment tends to improve performance by reducing some of the noise. That is easy to apply when using returns, but how do we apply this concept to a price-based strategy? Actually it is quite simple: using a fixed target percentage- say 1%- you multiply all returns since inception by the target divided by some lag of standard deviation. Then you create an index of those returns which becomes the new price series (being careful to avoid any lookahead bias). This volatility-adjusted index is what generates the signals for your channel strategy instead of the traditional price history. Of course in backtesting, you receive returns on the actual price history and not on the volatility-adjusted index. As a final point of clarification, you are not changing your position size as a function of volatility, instead you are just changing the input price.

So lets compare using a traditional 120-day Donchian Channel strategy that buys the S&P500 on new 120-day highs and sells and goes to cash (SHY) on 120-day lows versus the same strategy using a volatility-adjusted time series to generate signals. The lookback is a 20-day standard deviation to adjust daily returns to create the index (with a .75% vol target–note the choice of target doesn’t alter performance just the scale of the index). For this test we use SPY with data from Yahoo, and SHY with data extended from Morningstar. Note that the red line is NOT the equity curve of the strategy, but rather the Volatility-Adjusted Index created using SPY. The performance of the strategy using the index for signals is also highlighted in red:

In this case, performance is improved using the volatility-adjusted index for signals versus the actual SPY price. Here is the same strategy using DBC with the ETF data only (since the choice of extension of DBC can create significant variability in performance):

The strategy shows some promise and generates different signals at certain times than the traditional strategy. Perhaps using different risk metrics such as acceleration or using other filtering techniques may hold even more promise. This same concept can be applied with moving averages or any other time of price-based signal. Just another concept for the diligent researcher to experiment with. Perhaps applying fractals to generate charts may be another useful avenue of exploration.

]]>

I actually received a large volume of what could best be chararcterized as “hate mail” for one of the previous posts on percentile channels. In reading these comments I was reminded of Jimmy Kimmel’s funny segments where celebrities read mean tweets about themselves. While I did not publish these comments (I do not wish to alienate or prohibit those people who are kind enough to comment on the blog), needless to say most of them implied that I had presented a fraudulent strategy that badly misrepresented true performance. Since exact details were not provided on the strategy this is a difficult claim to justify. As a mountain of such comments piled in, I decided that it would be useful at this time to clarify how the allocations were calculated. The initial strategy was developed using a pre-built testing platform in VBA, so presenting the details for how the strategy calculates positions is easier than taking the time to build it in a spreadsheet.

It is rare that I present a formal strategy on this blog for several good reasons: 1) this is a blog for **new ideas** to inspire new strategies not for sharing code or spoon-feeding people with recipes 2) people actually pay money for strategies in the quantitative investment business, and giving one away for free seems like a pretty good deal. Who ever complains about free food? Hint: No one. 3) whenever I post strategies or indicators I get flooded with demands for spreadsheets and code. The tone of such emails is often terse or even desperate and implies that I have some sort of obligation to assist readers with replication or implementation on their end. Since the blog is free and competes for my often limited time while engaging in unrelated but paid business activities, meeting such demands is difficult to justify. I would comment that even the authors of academic articles to reputable journals rarely provide either: a) easy instructions for replication–in fact it is notoriously difficult to replicate most studies since either the instructions are vague or details are missing or b) assistance/support— authors rarely if ever provide assistance with replication and rarely answer such requests, even when their articles are supposed to contribute to some body of research (unlike a blog). I would like to think that CSSA has been considerably more generous over the years.

As a former professor of mine used to say: “I think you are responsible for doing your own homework and using your own brain”– perhaps a novel concept to those who simply wish to coast of the hard work and individual thinking of others. So without turning this into a prolonged rant, here is a “simple” (I will refrain from using that word in the future after the latest experience) schematic of how allocations are calculated for the strategy:

A couple key details first- the strategy was rebalanced monthly (allocations calculated and held through the month) and not daily. Also, the strategy is LONG ONLY. This means that any negative positions are ignored. The channel score or signals in the initial calculation can be long or short ie 1 or -1. This is probably the key reason why readers were unable to replicate since they probably used 1 or 0.

Notice that negative positions are used to calculate allocations but are ignored in the final calculations. Furthermore, the cash position is allocated as an excess to the total of active allocations and not included in the risk parity position sizing (which would make SHY a huge position due to its low volatility). So I hope that this helps reader’s implement/duplicate the strategy. Keep in mind that prior to 2006, some of the ETFs used had to be extended with other data which reader’s may not have access to. However, using ETF data only yields a sharpe ratio of about 1.5. Beyond this- readers are on their own. Good Luck!

]]>

To add some new ideas on the error-adjusted momentum strategy, I would suggest readers experiment with multiple time windows (ie the averaging period) and error lookbacks as well as data points with different frequencies from intraday,daily or even weekly and aggregate their signals to increase robustness. Risk or volatility can be substituted or also used in place of the error adjustment. The general concept of standardizing returns in some way to account for changing variance/error creates an effective non-linear filter that is a superior substitute to an adaptive moving average. In contrast, a typical adaptive moving average approach attempts to vary the lookback window (make the moving average faster or slower) as a function of some indicator. Academic studies on moving averages show that this type of approach demonstrates little success with a wide range of time series data outside of financial markets.

I have personally tried virtually every method I could find with an adaptive moving average framework and have had no material success. Part of the problem is that shifting to shorter-term moving averages increases standard error because you are using less data. Furthermore, by ignoring older data and shifting to a shorter window, you assume that there is no memory from changes in the dynamics of the time series. The success of volatility forecasting methods demonstrate in part that the influence of changes in the time series decay over time rather than all at once. The error-adjusted momentum approach is a nonlinear filter, and in general this class of methods tend to work better in my experience with financial time series. This particular filter permits a sufficient lookback window for averaging to achieve a good estimate (from a statistical sample size perspective) and retains information from dynamics that have evolved over time. The key is that it simultaneously manages to emphasize/de-emphasize portions of the data set based on the observed error (or some other metric). Substituting a weighted moving average in place of a simple moving average in the filter can also better capture the path dependence of changes in error.

As with any approach there are many different ways to apply the same concept, and readers are encouraged to experiment. The caveat is that it is better to use multiple approaches in an ensemble than to select the very best approach– the more things we try via experimentation (especially if there is no logical theory/hypothesis attached to it), the greater the risk of data-mining. A favorite quote from one of good blogs that I follow- Volatility Made Simple– says it best: “the concepts being exploited are much more important than the specific parameters chosen. All sets of parameters will, over the long-term, rise or fall together based on the success or failure of the core concept.”

]]>

Equities– VTI (or SPY)

Real Estate– IYR (or ICF)

Corporate Bonds– LQD

Commodities–DBC

for Cash we will use SHY

Here are the rules:

1) Use 60,120,180, 252-day percentile channels- corresponding to 3,6,9 and 12 months in the momentum literature- (4 separate systems) with a .75 long entry and .25 exit threshold with long triggered above .75 and holding through until exiting below .25 (just like in the previous post)

2) If the indicator shows that you should be in cash, hold SHY

3) Use 20-day historical volatility for risk parity position-sizing among active assets (no leverage is used). This is 1/volatility (asset A) divided by the sum of 1/volatility for all assets to determine the position size.

4) rebalance monthly

Here are the results for this simple strategy:

This is a very consistent strategy which is more notable for its low maximum drawdown and high sharpe ratio (near 2) than its sexy returns. Of course there are many alternatives to “spice” this up by varying the allocation among instruments, changing instruments or using leverage. I wanted to keep the asset list short and simple, and I chose corporate bonds since they provide some of the defensive characteristics of treasurys but with a higher yields and arguably lower systematic risk (no sovereign risk). Substituting the 10-year treasury with IEF instead of corporate bonds produces nearly identical results (1.9 sharpe, 11.8% Cagr, 5.8% max dd). There were better combinations of asset classes and parameters, but this compact list seemed manageable for a self-directed investor without a large portfolio.This is not the ultimate strategy by any means, but shows how to use percentile channels to produce a viable approach to tactical asset allocation.

]]>