Appearance
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
| Input | Type | Default |
|---|---|---|
| Short length | int | 5 |
| Long length | int | 10 |
| Color | color | "#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" });