Skip to content

Rate Of Change ​

Percent change over N bars.

Kind indicator · Drawn in its own pane

Try it ​

On the chart, press / and choose Rate Of Change under Oscillators. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
Lengthint9
Sourcesource"close"
Colorcolor"#2962FF"

Source ​

From packages/alphascript/indicators/roc.as.js.

js
indicator({ name: "Rate Of Change", shortTitle: "ROC", overlay: false, precision: 2 });
const length = input.int("Length", 9, { min: 1 });
plot(ta.roc(input.source("Source", "close"), length), { title: "ROC", color: input.color("Color", "#2962FF", { group: "Style" }) });
hline(0, { title: "Zero line", color: "#787B86" });

AlphaScript language v0.1 · runtime 0.2.0