Skip to content

Accelerator Oscillator ​

Awesome Oscillator minus its 5-bar SMA, coloured by direction.

Kind indicator · Drawn in its own pane

Try it ​

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

Inputs ​

InputTypeDefault
Growing colorcolor"#089981"
Falling colorcolor"#F23645"

Source ​

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

js
indicator({ name: "Accelerator Oscillator", shortTitle: "AC", overlay: false });
const hl2 = ta.calc([candle.high, candle.low], (h, l) => (h + l) / 2);
const ao = ta.calc([ta.sma(hl2, 5), ta.sma(hl2, 34)], (f, s) => f - s);
const ac = ta.calc([ao, ta.sma(ao, 5)], (a, m) => a - m);
plot(ac, { title: "AC", style: "columns", palette: [input.color("Growing color", "#089981", { group: "Style" }), input.color("Falling color", "#F23645", { group: "Style" })],
  colorIndex: ta.calc([ta.change(ac, 1)], (d) => (d >= 0 ? 0 : 1)) });

AlphaScript language v0.1 · runtime 0.2.0