Appearance
Moving Average Weighted
Linearly weighted mean of the last N values.
Kind indicator · Drawn on the price pane
Try it
On the chart, press / and choose Moving Average Weighted under Moving averages. To change it, copy the source below into the AlphaScript editor.
Inputs
| Input | Type | Default |
|---|---|---|
| Length | int | 9 |
| Source | source | "close" |
| Color | color | "#2962FF" |
Source
From packages/alphascript/indicators/wma.as.js.
js
indicator({ name: "Moving Average Weighted", shortTitle: "WMA", overlay: true });
const length = input.int("Length", 9, { min: 1 });
const src = input.source("Source", "close");
plot(ta.wma(src, length), { title: "WMA", color: input.color("Color", "#2962FF", { group: "Style" }) });