McGinley Dynamic Indicator: Formula, Settings and a Test Against the EMA in 1987
The McGinley Dynamic adjusts its speed to the gap between price and the line, falling fast when price drops below it and rising slowly when price is above. Here is John McGinley's formula, the N setting he suggested, and how it compared with a 20-day EMA through the rise, the crash and the range of 1987 and 1988.
On this page
The McGinley Dynamic is a price-tracking line designed by market technician John R. McGinley to follow price more closely than a moving average. It looks like one, but its step size changes with the gap between price and the line: it speeds up when price runs away below it and slows down when price runs above it. McGinley first outlined it in the Market Technicians Association's Journal of Technical Analysis in 1991 and published the full study there in 1997, according to Brian Twomey's 2010 article in Stocks & Commodities.
McGinley Dynamic and 20-day EMA on the S&P 500 in 1987
- Price, daily candles (hollow up, filled down)
- McGinley Dynamic, N = 12 (solid line)
- EMA(20) of the close, for comparison (dashed line)
How the McGinley Dynamic is calculated
Each new value moves the previous one toward the price by a fraction of the gap. In a plain exponential average that fraction is fixed. In the Dynamic it is divided by the fourth power of the ratio between price and the line.
When price is below the line, the ratio is under 1, its fourth power is smaller still, and the step grows: the line drops quickly. When price is above, the ratio is over 1 and the step shrinks: the line rises slowly.
Share of the gap closed in one step, McGinley Dynamic (12) vs. EMA (20)
LuxAlgo explains this asymmetry by McGinley's reasoning that “markets fall faster than they rise”, and stresses that, strictly, “it is not a moving average at all”, since no fixed window of prices is averaged.
Which N to use
LuxAlgo reports McGinley's suggestion to set N to roughly 60% of the moving average length you would otherwise use. That is why the chart pairs a Dynamic of 12 with a 20-day EMA. Using the same number for both does not give the same speed. With N = 20, on the same 1987 data, the Dynamic stayed on average 3.81% away from the close during the rise of January to August, against 2.05% for the EMA(20): it was the slower line of the two.
McGinley Dynamic against an EMA: a crash, a rise and a range
We measured, on the daily S&P 500 index, the average distance between the close and each line, as a percentage of the close, and how many times the close crossed the line, in three phases: the rise from January to August 1987, the fall from October 1 to November 30, 1987, and the range from February to June 1988.
Average distance between the close and each line, S&P 500, 1987 to 1988
- McGinley Dynamic (12)
- EMA (20)
Bars and crossings: the rise counts 168 sessions, with 9 crossings of the Dynamic against 13 of the EMA; the fall, 42 sessions, with 5 against 1; the range, 106 sessions, with 10 against 12. A crossing is a session whose close sits on the other side of the line from the previous close. Both lines run on daily closes and start from the simple average of the first N closes of the series, which begins on January 2, 1986, so they are fully warmed up by 1987.
The Dynamic did what it was designed for in the fall: it stayed much closer to price than the EMA. It did not track better in the rise or in the range, where the EMA was closer, as the formula's asymmetry predicts. Closer tracking also means more crossings in a fast market: 5 against 1 in the fall.
The signals that came out of it need the full story. The index made its record close of 336.77 on August 25, 1987. The close fell below the EMA on August 28 (327.04), back above it on August 31, and below both lines on September 1 (323.40); it crossed back above both in mid-September, and fell below both for the last time before the crash on October 6, at 319.22, nine sessions before October 19. After the crash, the close went back above the Dynamic on November 2, at 255.75, against the line at 253.94, then crossed it three more times that week and ended it below the line on November 6. That was early: the index then fell to its lowest close of the period, 223.92, on December 4, 12.45% lower. The close went back above both lines on December 9, at 238.89, fell below them the next day and crossed above both again on December 14, at 242.19. By June 30, 1988 the index stood at 273.50, 6.94% above the November 2 signal and 14.49% above the December 9 one.
S&P 500 after each up-cross of the Dynamic (12), late 1987
On daily Bitcoin, over the last 250 days to October 28, 2026, the Dynamic (12) was on average 3.88% away from the close against 3.34% for the EMA (20), with 32 crossings against 36: over that window the Dynamic was the more distant line.
How traders use it
- As a trend line: price above the line read as an uptrend, below as a downtrend.
- As a trailing reference: the line as a level for a stop in a falling market, where it follows price closely.
- In place of a moving average in a crossover rule, with N set to about 60% of the average's length (see moving average crossover).
Does it work?
On our data, the Dynamic followed price better than an EMA during a crash and worse during a rise and a range, which is what its formula implies; it does not show a trading edge. Our bench measures chart patterns detected by rule against random entries, not indicators (see our methodology). Other attempts at a faster average are the Hull moving average and the ALMA; the plain versions are on the moving average page, and the 1987 market itself is on Black Monday. More tools are listed with the trend indicators.
Frequently asked questions
What is the McGinley Dynamic formula?
MD = previous MD + (price − previous MD) / (N × (price / previous MD)⁴). The fourth power makes the line step faster when price is below it and slower when price is above it.
What is the best setting for the McGinley Dynamic?
There is no tested best value. McGinley's own suggestion, as reported by LuxAlgo, is about 60% of the moving average length you would otherwise use, for example 12 in place of a 20-day average.
Is the McGinley Dynamic better than an EMA?
It tracks price more closely in a fast fall and less closely in a rise. On the S&P 500 in 1987, it was closer than a 20-day EMA during the crash and further away during the rise and the 1988 range.
Who created the McGinley Dynamic?
John R. McGinley, a market technician, who published it in the Market Technicians Association's Journal of Technical Analysis: an outline in 1991 and a full study in 1997.
