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 tested price crossings of the Dynamic across markets after costs: buying them lagged the market, and selling them lagged it by a small, fragile margin; the results are in the section below (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.
Data from our test bench
Tested on our bench
We coded the 2 strategies taught on this page, buy and sell side, and ran them on stocks, ETFs, indices, forex, crypto and commodities. With all markets pooled (daily bars): 2 did worse than the market.
Price crosses the McGinley Dynamic, bullishLagged the market
Entry: Close crosses above McGinley Dynamic(14). Exit: Opposite signal (stop and reverse).
The trade itself made money on average, but less than the rest of the market over the same bars.
In detail, all markets pooled
On daily bars, the rule fired 603,442 times on 2,343 assets (stocks, ETFs, indices, currency pairs, crypto pairs and commodity futures) between 1970 and 2026, about once every 14 bars on each asset.
The average trade returned +0.36% before costs and the median trade −1.04%; 27% of trades made money, and the gains added up to 1.21 times the losses.
A trade lasted 3 bars at the median, half of them between 1 and 10 bars.
Over exactly the same bars, compared with an equal-weight basket of the other assets of the same market, the trades ended −0.21% per trade after costs (95% interval −0.24% to −0.17%).
- Signals
- 603,4422,343 assets, 1970 to 2026
- Average trade
- +0.36%before costs; median −1.04%
- Winning trades
- 27%profit factor 1.21
- Median hold
- 3 barshalf between 1 and 10
- Vs the market, after costs
- −0.21%95% interval −0.24% to −0.17%
After the signal, bar by bar
Share of signals where the price had moved in the signal’s direction after N bars, against the same assets at random dates (before costs).
| Bars after | 1 | 3 | 5 | 10 | 20 |
|---|---|---|---|---|---|
| After the signal | 50.0% | 51.9% | 52.1% | 53.4% | 54.6% |
| Random dates | 50.6% | 51.9% | 52.6% | 53.6% | 54.6% |
Over time
The history cut into three periods with the same number of signals: gap per trade against the rest of the market, before costs.
| Period | Signals | Vs market, before costs |
|---|---|---|
| 1970 to 2012 | 201,169 | −0.11% |
| 2012 to 2021 | 201,225 | −0.09% |
| 2021 to 2026 | 201,048 | −0.11% |
Stress tests
The same trades, measured again under harsher assumptions (vs market, after costs).
| Variant | Vs market | Result |
|---|---|---|
| As tested: entry at the signal close, standard costs | −0.21% | |
| Entry at the next bar's open | −0.23% | Holds |
| Trading costs doubled | −0.31% | Holds |
| 1% most extreme trades trimmed on each side | −0.36% | Holds |
With the trade we run on chart patterns instead (stop at 2 ATR, target at twice the risk, entry at the signal close), 38% of 600,595 trades hit the target first, for +0.16 R per trade on average against +0.15 R for the same trade at random dates of the same assets: no measurable difference from random dates.
Worst single trade of the whole test: −68.0% on CYN, signal of 2025-02-10.
Real trades from the test
Taken from the test itself on well-known assets: the indicator lines are the values the bench computed for that signal, the shaded zone is the time in the trade, from the signal close to the exit. Best and worst are chosen among these assets, not over the whole test.




Market by market
| Market | Bars | Signals | Avg trade | Winners | Vs market, after costs | Result |
|---|---|---|---|---|---|---|
| Stocks | daily | 523,270 | +0.32% | 27% | −0.19% | Lagged the market |
| ETFs | daily | 19,070 | +0.20% | 30% | −0.08% | No edge found |
| Indices | daily | 9,718 | +0.42% | 32% | n/a | Not measured |
| Forex | daily | 6,943 | −0.02% | 26% | −0.06% | No edge found |
| Crypto | daily | 38,827 | +1.04% | 19% | −0.51% | Inconclusive |
| Commodities | daily | 5,614 | +0.29% | 27% | −0.16% | No edge found |
| All markets | 4-hour | 317,243 | +0.004% | 23% | −0.29% | Lagged the market |
| Forex | 4-hour | 38,727 | −0.01% | 25% | −0.04% | Inconclusive |
| Crypto | 4-hour | 278,516 | +0.01% | 23% | −0.32% | Lagged the market |
| All markets | weekly | 85,098 | +2.92% | 29% | −0.39% | No edge found |
| Stocks | weekly | 74,610 | +2.91% | 29% | −0.39% | No edge found |
| ETFs | weekly | 3,290 | +1.88% | 34% | −0.09% | No edge found |
| Indices | weekly | 1,772 | +2.39% | 36% | −0.23% | No edge found |
| Forex | weekly | 1,404 | −0.21% | 25% | −0.25% | Lagged the market |
| Crypto | weekly | 2,883 | +9.85% | 17% | n/a | Not measured |
| Commodities | weekly | 1,139 | +1.96% | 24% | −0.68% | No edge found |
Price crosses the McGinley Dynamic, bearishLagged the market, fragile
Entry: Close crosses below McGinley Dynamic(14). Exit: Opposite signal (stop and reverse).
In detail, all markets pooled
On daily bars, the rule fired 607,679 times on 2,346 assets (stocks, ETFs, indices, currency pairs, crypto pairs and commodity futures) between 1970 and 2026, about once every 14 bars on each asset.
The average trade returned −0.36% before costs and the median trade −1.11%; 24% of trades made money, and the gains added up to only 0.79 times the losses. For this sell signal, a trade gains when the price falls (a short sale).
A trade lasted 3 bars at the median, half of them between 1 and 7 bars.
Over exactly the same bars, compared with an equal-weight basket of the other assets of the same market, the trades ended −0.17% per trade after costs (95% interval −0.19% to −0.14%). For a sell signal, a positive number means the asset did worse than the others, as the signal announced.
- Signals
- 607,6792,346 assets, 1970 to 2026
- Average trade
- −0.36%before costs; median −1.11%
- Winning trades
- 24%profit factor 0.79
- Median hold
- 3 barshalf between 1 and 7
- Vs the market, after costs
- −0.17%95% interval −0.19% to −0.14%
After the signal, bar by bar
Share of signals where the price had moved in the signal’s direction after N bars, against the same assets at random dates (before costs).
| Bars after | 1 | 3 | 5 | 10 | 20 |
|---|---|---|---|---|---|
| After the signal | 47.5% | 47.4% | 46.5% | 45.9% | 45.3% |
| Random dates | 48.2% | 47.4% | 47.0% | 46.2% | 45.3% |
Over time
The history cut into three periods with the same number of signals: gap per trade against the rest of the market, before costs.
| Period | Signals | Vs market, before costs |
|---|---|---|
| 1970 to 2012 | 202,627 | −0.05% |
| 2012 to 2021 | 202,569 | −0.04% |
| 2021 to 2026 | 202,483 | −0.10% |
Stress tests
The same trades, measured again under harsher assumptions (vs market, after costs).
| Variant | Vs market | Result |
|---|---|---|
| As tested: entry at the signal close, standard costs | −0.17% | |
| Entry at the next bar's open | −0.13% | Does not hold |
| Trading costs doubled | −0.27% | Holds |
| 1% most extreme trades trimmed on each side | −0.19% | Holds |
The result no longer holds when entering at the next bar's open instead of the signal close.
With the trade we run on chart patterns instead (stop at 2 ATR, target at twice the risk, entry at the signal close), 28% of 603,744 trades hit the target first, for −0.15 R per trade on average against −0.15 R for the same trade at random dates of the same assets: no measurable difference from random dates.
Worst single trade of the whole test: −280.5% on REQ/USDT, signal of 2021-11-24.
Real trades from the test
Taken from the test itself on well-known assets: the indicator lines are the values the bench computed for that signal, the shaded zone is the time in the trade, from the signal close to the exit. Best and worst are chosen among these assets, not over the whole test.




Market by market
| Market | Bars | Signals | Avg trade | Winners | Vs market, after costs | Result |
|---|---|---|---|---|---|---|
| Stocks | daily | 525,999 | −0.42% | 23% | −0.15% | Lagged the market, fragile |
| ETFs | daily | 19,065 | −0.27% | 23% | −0.07% | No edge found |
| Indices | daily | 9,715 | −0.11% | 25% | n/a | Not measured |
| Forex | daily | 6,944 | −0.04% | 25% | −0.06% | No edge found |
| Crypto | daily | 40,321 | +0.18% | 31% | −0.47% | Lagged the market |
| Commodities | daily | 5,635 | −0.18% | 25% | −0.17% | No edge found |
| All markets | 4-hour | 319,426 | −0.05% | 26% | −0.28% | Lagged the market |
| Forex | 4-hour | 39,816 | −0.01% | 25% | −0.04% | Inconclusive |
| Crypto | 4-hour | 279,610 | −0.05% | 26% | −0.31% | Lagged the market |
| All markets | weekly | 86,979 | −1.38% | 22% | −0.23% | Lagged the market |
| Stocks | weekly | 75,721 | −1.44% | 22% | −0.22% | Inconclusive |
| ETFs | weekly | 3,301 | −0.72% | 22% | −0.05% | No edge found |
| Indices | weekly | 1,774 | −0.39% | 24% | −0.22% | No edge found |
| Forex | weekly | 1,405 | −0.21% | 26% | −0.20% | No edge found |
| Crypto | weekly | 3,635 | −2.64% | 30% | n/a | Not measured |
| Commodities | weekly | 1,143 | −1.00% | 23% | −0.74% | Inconclusive |
Each strategy enters at the close of the signal bar and exits at the exit it teaches, without a stop. The test compares the asset with an equal-weight basket of the other assets of its market over exactly the same bars, net of trading costs; for a sell signal, beating the market means the asset did worse than the others. A result is shown as beating or lagging the market only when it survives a correction for the number of tests and holds in both halves of the history; it is marked fragile when entering at the next open, doubling costs or trimming extreme trades removes it. Daily index bars are not compared with other indices, because their closes fall at different hours; “Not measured” also covers samples too small to test. Rules were fixed before any result was seen. How we test
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.
