indicator · on price · open source

McGinley Dynamic indicator

McGinley Dynamic is a free open-source indicator by @deepwick. McGinley Dynamic is John Rung's attempt at a real-market-aware average that automatically… Deepwick Script runs a subset of Pine Script.

Deepwick · @deepwickv1Updated 3 Nov 2026▲ 0 users
Running…
Loading chart…

What McGinley Dynamic does

McGinley Dynamic is John Rung's attempt at a real-market-aware average that automatically speeds up in fast markets and slows in chop. Uses an adaptive denominator so the line never strays far from price for long.

  • More honest line than EMA/SMA on assets with rapid regime changes.
  • Raise N for steadier swings; the kernel already adapts internally.
  • Good single-line trend reference for indices and majors.

Source code

Deepwick Script, a subset of Pine Script · read-only

//@version=6
indicator("McGinley Dynamic", overlay=true)
len = input.int(14, "Length", minval=2, maxval=200)
src = input.source(close, "Source")
colorDim = input.color("color.olive", "Color  Dim")
var float md = 0.0
md := nz(md[1], src) + (src - nz(md[1], src)) / (len * math.pow(src / nz(md[1], src), 4))
p_MD = plot(md, "MD", color=colorDim, linewidth=2)
alertcondition(ta.crossover(close, md), "Price crosses above MD", "Price crossed above the McGinley Dynamic")
alertcondition(ta.crossunder(close, md), "Price crosses below MD", "Price crossed below the McGinley Dynamic")

Comments

No comments yet.

Sign in to comment.