bsharpe

McGinley Dynamic Average

Unlike moving averages such as Simple Moving Average or Exponential Moving Average, McGinley Dynamic avoids of most whipsaws and it rapidly moves up or down according to a quickly changing market. It needs no adjusting because it is dynamic and it adjusts itself.

Open-source script

In true TradingView spirit, the author of this script has published it open-source, so traders can understand and verify it. Cheers to the author! You may use it for free, but reuse of this code in a publication is governed by House Rules. You can favorite it to use it on a chart.

Disclaimer

The information and publications are not meant to be, and do not constitute, financial, investment, trading, or other types of advice or recommendations supplied or endorsed by TradingView. Read more in the Terms of Use.

Want to use this script on a chart?
// Based on formula from http://fxcodebase.com/wiki/index.php/McGinley_Dynamic
// Unlike moving averages such as Simple Moving Average or Exponential Moving Average, 
// McGinley Dynamic avoids of most whipsaws and it rapidly moves up or down according to a 
// quickly changing market. It needs no adjusting because it is dynamic and it adjusts itself.

study(title="McGinley Dynamic Average", shorttitle="McGinley", overlay=true, precision=6)
len = input(14, minval=1)
src = input(close, title="Source")

mg = na(mg[1]) ? src : mg[1] + (src - mg[1]) / (0.6 * len * pow(src/mg[1], 4))

plot(mg, color=orange, linewidth=4)