Appearance
Awesome Oscillator
5-bar minus 34-bar SMA of the bar midpoint.
Kind indicator · Drawn in its own pane
Try it
On the chart, press / and choose Awesome Oscillator under Oscillators. To change it, copy the source below into the AlphaScript editor.
Inputs
| Input | Type | Default |
|---|---|---|
| Growing color | color | "#089981" |
| Falling color | color | "#F23645" |
Source
From packages/alphascript/indicators/ao.as.js.
js
indicator({ name: "Awesome Oscillator", shortTitle: "AO", 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);
plot(ao, { title: "AO", style: "columns", palette: [input.color("Growing color", "#089981", { group: "Style" }), input.color("Falling color", "#F23645", { group: "Style" })],
colorIndex: ta.calc([ta.change(ao, 1)], (d) => (d >= 0 ? 0 : 1)) });