Skip to content

Volume Oscillator ​

Short minus long volume EMA, in percent.

Kind indicator · Drawn in its own pane

Try it ​

On the chart, press / and choose Volume Oscillator under Volume. To change it, copy the source below into the AlphaScript editor.

Inputs ​

InputTypeDefault
Short lengthint5
Long lengthint10
Colorcolor"#2962FF"

Source ​

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

js
indicator({ name: "Volume Oscillator", shortTitle: "Volume Osc", overlay: false, precision: 2, format: "percent" });
const shortLength = input.int("Short length", 5, { min: 1 }), longLength = input.int("Long length", 10, { min: 1 });
const s = ta.ema(candle.volume, shortLength), l = ta.ema(candle.volume, longLength);
plot(ta.calc([s, l], (a, b) => (b ? (100 * (a - b)) / b : NaN)), { title: "Volume Osc", color: input.color("Color", "#2962FF", { group: "Style" }) });
hline(0, { title: "Zero", color: "rgba(120,123,134,0.5)", style: "dashed" });

AlphaScript language v0.1 · runtime 0.2.0