Appearance
McGinley Dynamic
Moving average that speeds up and slows down with the market.
Kind indicator · Drawn on the price pane
Try it
On the chart, press / and choose McGinley Dynamic under Moving averages. To change it, copy the source below into the AlphaScript editor.
Inputs
| Input | Type | Default |
|---|---|---|
| Length | int | 14 |
| Source | source | "close" |
| Color | color | "#2962FF" |
Source
From packages/alphascript/indicators/mcginley.as.js.
js
indicator({ name: "McGinley Dynamic", shortTitle: "McGinley", overlay: true });
const length = input.int("Length", 14, { min: 1 });
const src = input.source("Source", "close");
plot(ta.recur([src, ta.ema(src, length)], { mg: NaN }, (s, x, e) => (s.mg = s.mg !== s.mg ? e : s.mg + (x - s.mg) / (length * math.pow(x / s.mg, 4)))),
{ title: "McGinley", color: input.color("Color", "#2962FF", { group: "Style" }) });