All indicators
Momentum / Own pane

Awesome Oscillator

Fast minus slow simple average of the median price, as columns colored by whether they rise or fall.

  • AO
  • Built into Spectral
  • Updates every tick
  • awesome oscillator
  • ao
  • bill williams
  • histogram
  • momentum
  • median price

By Spectral · v1.0.0

MIT-0: free to use, change and share, no attribution needed. What you build from it is yours.

Already in Spectral: add it from the Indicators toolbox. The file here is the same indicator written as a custom indicator, to change or learn from. Installed, it appears next to the built-in one, marked Custom.

Awesome Oscillator on a Spectral chart
Spectral chart with sample market data, default settings.

Overview

The Awesome Oscillator (Bill Williams) is the 5-bar simple average of the median price, (high + low) / 2, minus its 34-bar simple average, drawn as columns. A column is green when it is higher than the one before and red when it is lower or equal.

How to read it

Above zero the short-term average is above the long-term one, below zero beneath it. A run of green columns shows momentum building in the upward direction, a run of red columns in the downward direction, on either side of zero.

Williams described three setups: the zero-line cross; the saucer, a dip of red columns above zero (or a rise of green columns below zero) that turns back with the trend; and twin peaks, two lows below zero where the second is higher (or two highs above zero where the second is lower). Read them with price structure.

Settings and limitations

Defaults are the original 5 and 34 bars, as on TradingView. The first column appears on bar Slow length (bar 34 with the defaults). Changing the lengths changes the character of the indicator; the defaults are what traders compare.

Notes

Matches the Awesome Oscillator on TradingView and most platforms, including the coloring: a column equal to the previous one counts as falling.

Settings

Each setting appears in the indicator's settings panel in Spectral, next to a color setting for every output.

SettingTypeDefaultRange or optionsWhat it does
Fast lengthWhole number51 – 500Bars in the fast simple average of the median price.
Slow lengthWhole number341 – 500Bars in the slow simple average of the median price.

What it draws

Levels

  • Zero linedotted · 1 px#788493

Histograms

  • Risinghistogram bars#6FAF8A
  • Fallinghistogram bars#C98282

Source

Save it as awesome-oscillator.js and add it with Indicators → Custom indicators → Add file…. The format is explained in the custom indicators guide.

// Copyright (c) 2026 Spectral
// SPDX-License-Identifier: MIT-0
// Free to use, copy, modify and share: https://spectral.trade/docs/custom-indicators/LICENSE.txt
/** @type {import('./spectral-indicator').IndicatorV2} */
export default {
  schemaVersion: 2,
  id: 'awesome-oscillator',
  name: 'Awesome Oscillator',
  shortName: 'AO',
  version: '1.0.0',
  author: 'Spectral',
  description: 'Fast minus slow simple average of the median price, as columns colored by whether they rise or fall.',
  pane: 'oscillator',
  live: { lookback: 1 },
  inputs: {
    fastLength: { type: 'integer', label: 'Fast length', default: 5, min: 1, max: 500, description: 'Bars in the fast simple average of the median price.' },
    slowLength: { type: 'integer', label: 'Slow length', default: 34, min: 1, max: 500, description: 'Bars in the slow simple average of the median price.' },
  },
  levels: {
    zero: { label: 'Zero line', color: '#788493', lineStyle: 'dotted' },
  },
  columns: {
    rising: { label: 'Rising', color: '#6FAF8A' },
    falling: { label: 'Falling', color: '#C98282' },
  },
  docs: {
    overview: 'The Awesome Oscillator (Bill Williams) is the 5-bar simple average of the median price, (high + low) / 2, minus its 34-bar simple average, drawn as columns. A column is green when it is higher than the one before and red when it is lower or equal.',
    howToRead: 'Above zero the short-term average is above the long-term one, below zero beneath it. A run of green columns shows momentum building in the upward direction, a run of red columns in the downward direction, on either side of zero.\n\nWilliams described three setups: the zero-line cross; the saucer, a dip of red columns above zero (or a rise of green columns below zero) that turns back with the trend; and twin peaks, two lows below zero where the second is higher (or two highs above zero where the second is lower). Read them with price structure.',
    settings: 'Defaults are the original 5 and 34 bars, as on TradingView. The first column appears on bar Slow length (bar 34 with the defaults). Changing the lengths changes the character of the indicator; the defaults are what traders compare.',
    notes: 'Matches the Awesome Oscillator on TradingView and most platforms, including the coloring: a column equal to the previous one counts as falling.',
  },
  calculate(ctx) {
    const { bars, inputs, ta } = ctx;
    const median = bars.map((bar) => (bar.high + bar.low) / 2);
    const fast = ta.sma(median, inputs.fastLength);
    const slow = ta.sma(median, inputs.slowLength);
    const rising = [];
    const falling = [];
    let previous = null;
    for (let index = 0; index < bars.length; index += 1) {
      const value = fast[index] === null || slow[index] === null ? null : fast[index] - slow[index];
      const up = value !== null && (previous === null || value > previous);
      rising.push(up ? value : null);
      falling.push(value !== null && !up ? value : null);
      previous = value;
    }
    return { levels: { zero: 0 }, columns: { rising, falling } };
  },
};

Adapt it with an LLM

Paste this into your assistant and replace the second-to-last line with the change you want.

Start from this Spectral custom indicator: https://spectral.trade/indicators/awesome-oscillator.js
Format reference: https://spectral.trade/docs/custom-indicators.llm.md
Keep the file format and every rule of the reference; give the result a new id, name, shortName and version, and update docs and input descriptions to match.
Keep its live updates exact and fast (section "Fast live updates" of the reference): carry values from bar to bar only through ctx.ta, and raise live.lookback if the change reads further back; Spectral rejects a file whose live updates differ from a full recalculation or are too slow.
Change I want: <describe the change>
Answer with the complete file in one code block, ready to save as <id>.js.