Ed Seykota, 2003 - 2007 ... Write for permission to reprint.

Ed Seykota's

Frequently Asked Questions

FAQ Index & Ground Rules  ...  Tribe Directory - How to Join

TTP - The Trading Tribe Process  ...  Rocks  ...  Glossary

  TTP Workshop  ...  Resources  ...  Site Search  ...  The Trading Tribe Book

TSP: Trading System Project  ...  Breathwork

Associates Program  ...  Chart Server  ...  Contact Us

 

 

Exponential Lags

(Exponential Averages)

(c) 2005 by Ed Seykota

 

 

 

Summary

 

In this section we examine one of the basic tools for detecting trends, the Exponential Lag. Traders sometimes refer to the exponential lag as an exponential average - although a lag is not, strictly, an average. Exponential Lags differ from one another only in their Time Constants.  The Time Constant determines the speed with which the Lag tracks the price.  An Exponential Lag with a shorter Time Constant tracks the Price more closely. Traders spend considerable time and effort running simulations to find Time Constants that optimize the profitability of their trading systems.  For theoretical, very smooth long-term price moves (ones without short term noise and fluctuation) a very short Time Constant optimizes profit.  For real price moves (ones that do include a lot of noise) very short Time Constants produce devastating strings of short-term whipsaws.  In general, Exponential Lag systems do not work very well for any kind of cyclic markets.  They work well for markets with sustaining trends. 

 

Your Car Bumper is a Physical Analog

 

If you grasp the front bumper of your car, and try to push it downward, and lean heavily on it, you might be able to move it  a couple inches.  Or, if you try to lift it with all your might, you might be able to raise it a couple inches.  If you are feeling energetic and also like exercise machines, you might be able to rock the car up and down by alternating between pushing down and pulling up. You might be able to move the bumper a few inches every couple seconds. 

 

Now, if you try to alternate between pushing and pulling faster (with a higher frequency, say twice per second), you may find you can only move it slightly.  If you try still higher frequencies, say 10 times per second or more, you may find you can't seem to budge it at all.

 

In this example, the car acts as a "low-pass" filter.  That is, it passes or responds to low frequencies and does not pass or respond to high frequencies.

 

Low-Pass Filter

 

Exponential averages, as we use them in trading, are also low-pass filters.  They respond to the low frequency secular trend of prices and do not respond to the high frequency noise.  Long term trend followers want to filter out the high frequency noise and follow the long term trend, so long-term trend traders all use some form or another of low-pass filtering. Many of them use exponential averages.  Other methods include moving average, weekly rules, support and resistance lines and trend lines.

 

Most methods of low-pass filtering are similar. The type of method matters less than the value of the time constant.

 

How to Compute it

 

The computational form of the exponential lag or exponential tracker is:

 

ELt = ELt-1 + dt * (P - ELt-1) / TC

 

ELt

current Exponential Average

ELt-1

previous Exponential Average

dt

delta time since last computation

P

current Price

TC

averaging Time Constant

 

Say you compute your 10-day TC Exponential average once per day.  That makes dt = 1 day and TC = 10 days. Note, the ramp-equivalent moving average has an averaging time of 2*TC - 1 = 19 days, from  TC = (MAT + 1) / 2.

 

Say the price is historically at $10 and it jumps to $20.

 

Then, in the equation, (P - ELt-1) is the difference between the price ($20) and the Exponential Lag ($10) or $10.  We take one tenth of this amount (1 / TC) or $1, and add it to the Exponential Average to get the new Lag which now stands at $11.

 

A Flow Chart of the Computation

 

 

 

Flow Chart for the Lag (Exponential Average)

 

The valve [ (P - EA) / TC ]  adjusts the flow rate of correction that changes the Exponential Average.  When the difference between Price and Exponential Average is large, the correction rate is large.  As the Exponential Average approaches the price, the correction rate decreases.  The Time Constant also determines the correction rate.  The longer the time constant, the slower the correction rate.

 

Computation by Spreadsheet

 

We can see this process at work, in a spreadsheet. To get a gut feeling for this process, I recommend you carry out this computation by hand.

 

 

 

Spreadsheet Computation

for Exponential Average

 

 

If you carry this out by hand or on a spreadsheet, you get the classic graph where the Exponential Average decays toward its new equilibrium value.  The Exponential Average rises toward the goal at a rate proportional to the distance it still has to go.  The closer it gets, the slower it changes.

 

Computation in a Graph

 

 

 

 

Graph of Spreadsheet Computation

for Exponential Average

 

Price (dark blue) suddenly rises from 10 to 20.  The Exponential Average of price (light blue) rises exponentially toward the new value.  Traders use exponential averages (and other forms of tracking) to place stop-loss orders in an attempt to lock in profits.  Price and Exponential Average have units of dollars ($).  The correction rate ( [P - EA]/TC) has units of dollars per day ($/day).

 

 

As long as the price remains above the Exponential Average, the Exponential Average keeps moving higher, although at exponentially small rates.  If we set a protective sell stop at the current Exponential Average, we can use it to lock in more and more profit.

 

Engineers call this kind of chart a Step Response.  It shows how the Exponential Average responds to a step up in price.  We can also show a chart of how the Exponential Average responds to a series of steps, in this case a few up, and then a few down.

 

We can see that the Exponential Average tracks the price and gives a sell signal when the price crosses beneath it.

 

Exponential Average can Detect Trend Change

 

 

 

Exponential Average

as a Trading Tool

 

The Exponential Average (light blue) tracks the price (dark blue). When the Price crosses below the Exponential Average, the crossover signals a change in trend from up to down.  Traders who place a trailing stop-loss order at the Exponential Average Price receive a fill at the next price. In this case, they enter an order to sell on a stop at $45 and get a fill at $40.

 

 

The Exponential Average Tracks best when the prices move slowly and the Average has time to track the price.  The Exponential Average tracks the price, smoothes the price and lags the price. Some engineers call an Exponential Average a filter, smoother, tracker or lag.

 

Tracking as a Function of Frequency

 

One way to see how the Exponential Average responds to a variety of frequencies is to draw a Frequency Response curve.  This curve shows how far the Exponential Average moves in response to stimulation at various frequencies.  The result is similar to the result you get with the car bumper.  The Exponential Average has enough time to move at low frequencies and hardly moves for high frequencies.

 

 

10-Day Exponential Average

Tracks a 50-day Cycle

 

The EA reaches about 13.5 on the first cycle

 

 

 

 

 

10-Day Exponential Average

Tracks a 25-day Cycle

 

The EA reaches about 12.5 on the first cycle

 

 

 

 

 

10-Day Exponential Average

Tracks a 10-day Cycle

 

The EA reaches about 11.5 on the first cycle

 

 

These runs show that, for high frequency price cycles, the Exponential Average does not have time to track the price.  It tracks more fully at low frequencies. The Exponential Average is essentially a low-pass filter.

 

Looking for the Best Average

 

Another way to see this frequency effect, in a way that relates directly to trading, is to keep the price curve constant and change the Time Constant for each run.  This is the method system designers use to find the system parameters that work best on historical data. 

 

In the case of prices that move very smoothly and sinusoidally, of course, the best exponential average is a very short one, since it tracks very closely and gives a signal quickly after the price changes direction.

 

In actual practice, few traders use very short Exponential Averages, or even just one Exponential Average since the price may get in a mode in which it crosses back and forth over the Exponential Average repeatedly and generates a string of whip-saws on alternating days. 

 

Traders generally use a fast average and a slow average, and wait for the fast average to cross over the slow average before executing a trade.  This minimizes the dithering effect, at the expense of waiting for the price to establish its direction.

 

In the next study, I show profit versus two moving averages of various lengths.  To normalize the study, I measure the Time Constants in fractions of the period of the sinusoidal price curve.

 

 

Exponential Trading System

 

.5 & .225 ==> -70%

 

Black: Price,

Green: Slow EA (.5).  TC = .5 X the period of the price.

Red: Fast EA (.225).  TC = 22-1/2% of the period of the price.

 

The short bars indicate the crossovers. The circles indicate the trade prices.  Note that by the time the red line crosses the green line, the price is already way past the red line, so the trader does not get prices close to the point of crossover.  In this case, the trader sells near the bottom and buys near the top of each cycle, losing about 70% of the move on each trade.

 

 

 

 

Exponential Trading System

 

.55 & .075 ==> -10%

 

Black: Price,

Green: Slow EA(.55).  TC = .55 X the period of the price.

Red: Fast EA(.075).  TC = .075 X the period of the price.

 

Note that by the time the red line crosses the green line, the price is already somewhat past the red line, so the trader does not get prices close to either average at the point of crossover.  In this case, the trader sells a little below the mid-point and buys a little above the mid-point of each cycle, losing about 10% of the move on each trade.

 

 

 

Exponential Trading System

 

.10 & .025 ==> + 50%

 

Black: Price,

Green: Slow EA(.1). 

Red: Fast EA(.025). 

 

In this case, the trader sells a little after the top and buys a little after the low of each cycle, making about 50% of the move on each trade.

 

 

 

 

Exponential Trading System

 

.05 & 0.0 ==> + 80%

 

Black: Price,

Green: Slow EA(.05). 

Red: Fast EA(0.0). 

 

In this chart, the red line overlays the black line exactly, hiding it.  This 2-Average system becomes a 1-Average system.  The trader sells right after the top and buys right after the low of each cycle, making about 80% of the move on each trade.

 

Summary Chart

 

The summary chart below shows that increasing the TC for either filter tends to diminish profit.

 

Across: TC for Slow Average, 0 to 140%, increments of 10%.

Down: TC for Fast Average, 0 to 37.5%, increments of 2.5%.

Top left corner (0,0), bottom right corner (140, 37.5).

 

Percentages are of the period of price oscillation.

 

 

Summary of Double Exponential Average Tests

for Smooth, Sinusoidal Price Moves

 

In general, fast averages work much better than slow averages for smooth sinusoidal price moves. 

 

For single moving average systems (fast average TC = 0) all values of TC for the single average are profitable. See top line.

 

For double moving average systems with the fast TC = 2.5%, values of slow TC below 100% are profitable. See second line.

 

For double moving average systems with the fast TC = 5%, values of slow TC below 50% are profitable. See third line.

 

Increasing either the slow or fast TC reduces profitability. 

 

Prices are, however, neither Smooth nor Sinusoidal

 

If have a prices series that behaves regularly and smoothly, such as the computer sinusoidal prices in these studies, then we can simply use the shortest possible Time Constants to optimize our profits

 

Prices do not, however, behave so nicely.  Actual price histories contain a superposition of sine waves with a wide range of frequencies.  If you choose a Time Constant short enough to generate profits at one frequency, you find it is also long enough to generate losses at a higher frequency. 

 

In the limit, a very short Time Constant produces devastating strings of short term whip-saw losses.

 

In general, Exponential Averages do not work very well as a trading system, for sinusoidal markets.  Traders know that trend-following systems tend to lose money in sideways, trading range markets, and make money in long-term trending markets.

 

 

Exponential Average and Complex Waves

 

In this study, we test our double average system on a  superposition of two sine waves.  We see that there is no averaging system that shows a profit.