Trend indicators

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.

· Founder of PatternsWizard
Checked 8 min read
McGinley Dynamic(12) and EMA(20)
On this page
  1. How the McGinley Dynamic is calculated
  2. Which N to use
  3. McGinley Dynamic against an EMA: a crash, a rise and a range
  4. How traders use it
  5. Does it work?
  6. Frequently asked questions

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

337.9277.2216.5Jan 7, 1987Jul 6, 1987Dec 31, 1987
  • Price, daily candles (hollow up, filled down)
  • McGinley Dynamic, N = 12 (solid line)
  • EMA(20) of the close, for comparison (dashed line)
McGinley Dynamic(12) and EMA(20) on S&P 500 index, daily, January 7, 1987 to December 31, 1987. Illustration of how the indicator reads, not a backtest.

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)

Price 20% below the line (ratio 0.8)20.35%Price 10% below (ratio 0.9)12.70%Price on the line (ratio 1)8.33%Price 10% above (ratio 1.1)5.69%Price 20% above (ratio 1.2)4.02%EMA (20), at any ratio9.52%
Our computation; the inputs and the method are in the text.The Dynamic moves by 1 / (12 × ratio⁴) of the gap at each bar; the EMA (20) always by 2 / 21. Below the line the Dynamic steps faster than the EMA, above it slower.

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

Rise, Jan. 2 to Aug. 31, 19872.54%2.05%Fall, Oct. 1 to Nov. 30, 19874.34%7.14%Range, Feb. 1 to June 30, 19881.95%1.71%
  • McGinley Dynamic (12)
  • EMA (20)
Our computation; the inputs and the method are in the text.Mean of |close − line| / close over the sessions of each phase: the lower bar is the line that tracked price more closely.

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

Nov 2, 1987 cross, to the Dec 4 low−12.45%Nov 2, 1987 cross, to June 30, 1988+6.94%Dec 9, 1987 cross, to June 30, 1988+14.49%Dec 14, 1987 cross, to June 30, 1988+12.93%
Our computation; the inputs and the method are in the text.Change from the close of the up-cross session to the close of the later date, daily S&P 500 index. Four signals in one market: an illustration, not a test.

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.

Every pattern's results on one sheet

The only pattern cheat sheet with tested stats: 152 patterns, what the textbook says and what really happened on 6 markets. Free PDF, sent to your inbox.

One email with the PDF, then a note when a result changes. Unsubscribe anytime. Privacy.

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.

Sources

  1. Brian Twomey, The McGinley Dynamic, Technical Analysis of Stocks & Commodities, March 2010
  2. LuxAlgo Library, McGinley Dynamic
  3. TradingView Help Center, McGinley Dynamic
, Founder of PatternsWizard

Passionate about finance, quantitative trading and data analysis. Amaury built the PatternsWizard test bench, which detects each pattern on full price history and measures what happened next against random entries.

PatternsWizard tests chart and candlestick patterns on full market history, against random entries. How we test patterns.

179 patterns testedRandom-walk self-test passed

All trend indicators articles