Friday, March 22, 2013

Main Article: MetaStock Monitor MARCH - APRIL 13

A Simple, Powerful Method for Trading Different Market Environments
Contributed by the Dynamic Market Lab, LLC

In 2004, the Dynamic Market Lab, LLC (our, us, we) introduced John Ehlers’ signal processing applications for the markets to the MetaStock community through introduction of the Adaptive Cycle Toolkit (ACT). The intent was clear; demystify powerful, but complex concepts and mathematics for immediate application to trading in the easily understandable MetaStock formula format. As time passed, it became apparent the real insight behind his pioneering work lay not in bringing these engineering tools to bear for market analysis, but in recognizing how these tools should be combined for maximum effectiveness.

In this article, we present one of the best approaches revealed by our extensive work with ACT. The approach is simple, powerful, and allows a trader to quickly, confidently identify different market environments, and execute a logical approach to capitalize on them, or stand down. The approach is described in the ensuing paragraphs, and all code is available from MetaStock with purchase of ACT. Discussion of the approach may appear complex, but we want you to understand the concepts, and feel comfortable with them. Fret not, application of the tools is very simple.

Three ACT or ACT modified functions are used to a) identify trend, b) measure trend strength and noise, and c) identify low risk entry points within a trend. A multi-faceted trading approach across different market modes (trending, drifting) is then suggested. The discussion below may appear complex, but the application of the tools is simple.

This approach is based on the Laguerre Transform, a modified version of David Sepiashvilli’s Trend Quality Indicator (TQI) (the ACT TQI), and a fisher transformed version of the Laguerre Stochastic.
  • The Laguerre Transform is an average of prices derived from a mathematically “warped” cross-combination of only three current and past data points at each time interval (based on trader’s selected chart interval for trading). The three data points ensure rapid response to change; the “warped” cross-combination ensures smoothness. Prices tend to rapidly cross and “ride” above (below) the average during uptrends (downtrends), and “hang” on the average during drifting markets. This average is plotted as an overlay on prices in the chart window.
  • The original TQI measures trend direction, trend strength, and market drift. It is powerful in its own right, but requires explanation to understand, and understand why we modified it.
  • David Sepiashvilli introduced the TQI in a Stocks and Commodities (S&C) article, Trend Quality Indicator, as a technique to measure trend strength and noise. Copies of the article may be purchased online from S&C for $2.95.
  • Sepiashvilli uses a difference between seven (7) and fifteen (15) period exponential averages to identify changes from an uptrend to a downtrend, and back again. At each crossover point, he resets his computations. He then performs the following steps: 1) measures cumulative bar to bar price change since the crossover point, 2) averages this change to compute the trend, 3) subtracts the trend from the cumulative change to compute the noise, 4) computes the square root of the moving average of the squared noise over time and multiplies this by 2. This multiplication is done so that when trend is compared to noise, if the ratio is 1 (uptrend) or -1 (downtrend), it means the trend is as strong as twice the noise. This “factor of 2 times noise” is a benchmark often used for distinguishing the onset of a trend from noise, 5) finally, he computes the ratio between the trend and noise. If the ratio is > 1, an uptrend is in force. If it is <-1, a downtrend is in force. If the result is – 1 < ratio < 1, the market is considered to be drifting. According to Sepiashvilli, the higher (lower) the ratio, the greater the strength of the uptrend (downtrend).
  • We originally plotted the MetaStock version of this indicator from Stocks and Commodities Trader’s Tips code, but observed the code had an error. This was evident from the fact the indicator was not centered around zero. Since the indicator is reset at every crossover point (see above), it must by definition move back and forth across the zero line. Based upon discussion with a contact on the MetaStock forum, we were able to get corrected code that plots correctly for Sepiashvilli’s original formulation. We can supply this corrected code.
  • A basic premise behind using adaptive tools is that markets are dynamic. Fixed period lengths do not always timely identify shifts in markets between trends, cycles and noise. Although the logic behind the TQI is very sound, we thought we might be able improve it a bit by replacing the fixed period lengths with ACT functions.
  • Enter the ACT indicators named Mama/Fama (Cybernetic). These are nonlinear averages that speed up / slow down based on how fast the measured cycle is changing. Fama is set to follow behind the rate of change of Mama. The relationship between these two adaptive averages means it is hard for the two to cross, or cross by very much, unless a meaningful move has occurred. If Mama and Fama are substituted for the seven (7) and fifteen (15) period values in the TQI, this means it will be very difficult for the two to cross enough to exceed the noise thresholds of 1 or -1, unless a meaningful move has occurred. Furthermore, these two averages are adaptive and should rapidly change as market conditions change. Thus, there is little need to continue to optimize fixed values (such as 7, 15) for moving averages. In trading systems, the fewer the optimized parameters, the more robust the system tends to be.
  • In constructing the inputs for Mama/Fama, we drew upon another concept from Ehlers’ work - ACT’s Signal to Noise function. We set a variable equal to this ratio, and used it to accelerate or slow down Mama/Fama’s cycle based computations. In other words, we would let both market cycles, and market noise, tell us what is happening.
  • In daily plots of IBM (2000 through early 2007) (not shown to save space, available upon request), Sepiashvilli’s choice of parameters was quite robust, and tracked our ACT TQI quite closely. However, there were six periods during this time, ranging from a few weeks to a month, the ACT TQI identified range bound markets (-1 < ACT TQI < 1) much better than the original TQI. In candor, there was one time the original TQI was superior. The original TQI registered a slight uptick in value a few days before there was a price up gap…luck, maybe, but it did nonetheless. However, it is interesting to note the other six periods where the ACT TQI performed better, the markets made a more continuous transition from one price to another, and did not exhibit an abrupt gap.
  • Thus, there is reason over a substantial span of years for a market which fell heavily, rose heavily, and drifted to believe the ACT TQI improved the traditional TQI, and thus we will use this modified version (i.e., the ACT TQI.)
  • The ACT TQI is plotted in the first indicator pane. The red horizontal lines are placed at +1 (weak uptrend = 2* noise) and -1 (weak downtrend = 2* noise). If the ACT TQI > 1, an uptrend is in force. If the ACT TQI < -1, a downtrend is in force. If the -1 < ACT TQI < 1, the market is drifting. Divergences between the ACT TQI and price are, like other traditional divergences, a warning sign of possible, imminent change.
  • Lastly, the fisher transformed version of the Laguerre Stochastic (FLS) is a statistically transformed version of a stochastic indicator, except the stochastic is computed from three prices first “warped” through application of the Laguerre mathematics. The three data points ensure rapid response to change; the “warped” cross-combination ensures a smooth stochastic. The fisher transform is then applied to the Laguerre Stochastic to ensure it is properly distributed according to the normal distribution function (i.e., bell curve in statistics). Many market price variations do not fit the normal distribution, and the fisher transform is one statistical technique that can be applied to help ensure computations based on such prices are normally distributed. The FLS is plotted in the second indicator pane. The red horizontal lines are placed at +2.5 standard deviations (potentially overbought) and -2.5 (potentially oversold).
OK, now you have been patient, and the fun begins...

Trend Following:
Use crossovers of price against the Laguerre Filter as the earliest warning of a trend change. Compare these crossovers to the ACT TQI. If prices are above the Laguerre Filter and the ACT TQI is > 1, a strong uptrend is likely in place, and do not trade against it. If prices are below the Laguerre Filter and the ACT TQI is < -1, a strong downtrend is likely in place, and do not trade against it. If you are trend follower, you can use these confirmed signals to initiate a trend position. We leave this to the viewer to examine the charts presented. We believe the confirmation points of the two indicators, and the trend direction to trade, are straightforward.

Mean Reversion Trading: (i.e., buy dips in an uptrend, sell peaks in a downtrend)

Mean reversion trading is based on the simple principle that when prices move far away from their average price they tend to move back to their average. This may be true in both trending and drifting markets. However, we should not employ this approach without a sound method. A strongly trending market can move prices farther from their average than expected.

Use the position of prices relative to the Laguerre Filter, and the ACT TQI to determine the market’s state. If prices are above the Laguerre Filter, and the ACT TQI is > 1, enter long trades only when the fisher transformed Laguerre Stochastic is below -2.5 standard deviations (oversold). If the price “hooks” down near the Laguerre Filter, this is even more desirable for entering long trades. If prices are below the Laguerre Filter, and the ACT TQI is < - 1, enter short trades only when the fisher transformed Laguerre Stochastic is above +2.5 standard deviations (overbought). If the price “hooks” up near the Laguerre Filter, this is even more desirable for entering short trades.

This allows us to buy dips in an uptrend, and sell peaks in a downtrend. We are capitalizing on both trend and price extremes, and using both to raise our odds of success. It is not recommended to use the oscillator values alone to take trades in the opposite direction of a strong trend. At this point, our examination of the market’s state indicates a strong trend exists, and we should not trade against it.

Range Bound or Drifting Markets:

If prices are above the Laguerre Filter, and the ACT TQI is -1< ACT TQI <1, enter long trades only when the fisher transformed Laguerre Stochastic is below -2.5 standard deviations. If prices are below the Laguerre Filter, and the ACT TQI is -1< ACT TQI <1, enter short trades only when the fisher transformed Laguerre Stochastic is above +2.5 standard deviations. During very noisy, drifting scenarios, prices tend to “hang on” to the Laguerre Filter, they are not above it (uptrends) or below it (downtrends.) In such cases, this may not be worth trading, unless the trader is selling options or option spreads to collect premium decay. These are lower probability trades because we do not have the benefit of a strong trend. These trades are strictly “range bound” trades. They may be very profitable during extensive periods of market drift. At the first sign of a price crossover of the Laguerre Filter or ACT TQI value moving beyond the +1/-1 limits, and in directions against your trade, exit immediately.

Please refer to the attached slides, and vertical lines indicating examples of these trade setups based on the rules explained above.


Three carefully designed tools allow a trader to operate a simple, powerful approach across a spectrum of market conditions. Although the concepts behind the indicators we have discussed may be complex, applying them is not.

Trading is often the most successful when it is simple, and based on sound principles of market behavior. We hope that we have provided a more powerful perspective on market behavior© for you, and that you will take a look at the powerful tools and concepts in the Adaptive Cycle Toolkit (ACT).
ACT is available from MetaStock’s site in a convenient downloadable format on a risk free trial.


The Adaptive Cycle Toolkit (ACT) is a product of the Dynamic Market Lab, LLC. The techniques described in this article, and the software and related manuals, are based on approaches some consider to be experimental. As a result, this information is offered for educational purposes only. Concepts or techniques presented are not guaranteed or warranted to be profitable.

Users apply the product strictly at their own risk. They must understand that trading in stocks, commodities or other instruments has significant risks, and substantial losses may occur.

The creators of this product or authors of this article are not acting in a capacity as investment or trading advisers. Readers of this article or users of the product must accept full responsibility for their investment or trading decisions, and should seek professional investment counsel before beginning a trading/investment program.

About the ACT Developers:

Michael Burgess
  • Co-founder of The Dynamic Market Lab, LLC. Conceptualized the ACT product.
  • He received published credit for his editorial contributions to Cybernetic Analysis for Stocks and Futures, and has a unique perspective on John Ehlers work.
  • He has over twenty (20) years of experience as a consultant with domestic and international corporations dealing with complex issues such as derivatives and other financial issues.
  • He holds a BA from Duke University, and a Masters in Taxation from the University of Denver's Graduate Tax Program.
Brad Ulrich
  • Co-founder, and developer for The Dynamic Market Lab, LLC.
  • He has been a C++ application developer for a healthcare software company, a mobile application developer, a technology coordinator in the ethanol industry, and currently provides litigation support work in the software and technology fields to several leading companies.
  • He holds BS degrees in computer science and mathematics from Vanderbilt University with a background in algorithm design, signal processing, statistics, and numerical analysis. His academic experience includes the design and implementation of algorithms for recent mathematical theory on irregular sampling and reconstruction of digital signals in shift-invariant and wavelet spaces.
Post a Comment