Bentrix Docs
HomePricingDashboard

Accelerator Oscillator Accelerator

Bill Williamsoscillatorone linein every package

Accelerator Oscillator, Bill Williams' — the Awesome Oscillator minus its own 5-period average.

It measures the rate at which the AO's gap is changing, which is a second difference of price. Readings: the side of zero and the bar colour, on the same rule as the AO. Being one derivative further out, it changes sign more often than the AO does.

01The study, live

Live figureScroll to zoom, drag the bars to pan.
0
bar —O — H — L — C —histogram —first value at —
Show where:

Computed by Bentrix’s own code over the same synthetic bars on every page — an illustration of how the study behaves, not a market.

What this figure shows

The figure is computed over 300 sample bars. Accelerator has no value on the first 37 — the bars it needs before it can answer — and its first value stands on bar 38. Its bars run between -0.00086 and 0.0015 on these bars, and the last value is -0.00037. Counting the conditions the study declares on these bars: crosses above 0 16 times; crosses below 0 17 times; the histogram turns up 25 times; the histogram turns down 25 times. Press a condition under the figure to see each place marked. As states rather than moments: is above 0 on 113 bars; is below 0 on 150 bars.

02Its parts, named

The bars it readseach bar's open, high, low and closeWarm-upno value on the first 37 bars: thestudy needs them before it cananswerThe barsthe study's own value on each bar,drawn as a bar from zeroThe zero linethe centre line: where the studychanges sign
Computed by Bentrix’s own code over the sample bars. It is drawn on once, as you reach the figure.

03What you see

The Accelerator is the AO minus its own 5-bar average — the change of the AO's change.

The Accelerator is a histogram around zero in a pane of its own, each bar in one of two colours: one where the bar is higher than the bar before it, the other where it is lower. The colour says which way the value is moving; the side of zero says where it stands.

04Where it comes from

Bill Williams' Accelerator Oscillator, from New Trading Dimensions (1998), is the Awesome Oscillator minus its own 5-bar average. His argument: momentum changes before price does, and the change of momentum changes before momentum.

05The formula

AC=AO−SMA(AO,5),AO=SMA(H+L2,5)−SMA(H+L2,34)
H, Lthe bar's high and low
AOthe Awesome Oscillator, defined in the same formula
SMA(x,n)the simple average of x over n bars

06A worked example

Suppose the Awesome Oscillator's last five values were 0.40, 0.55, 0.70, 0.78 and 0.80.

Their average is (0.40 + 0.55 + 0.70 + 0.78 + 0.80) / 5 = 0.646.

AC = 0.80 − 0.646 = 0.154

The AO is still rising, but by less each bar (+0.15, +0.15, +0.08, +0.02). On the bar before, AC was 0.78 − (0.30 + 0.40 + 0.55 + 0.70 + 0.78) / 5 = 0.234. The Accelerator has already turned down while the AO is still making highs — which is what it is for.

The same arithmetic on real bars: take eight bars with highs 21, 22, 24, 24, 25, 26, 26, 27 and lows 18, 19, 20, 21, 21, 23, 23, 23, so that their median prices are 19.5, 20.5, 22.0, 22.5, 23.0, 24.5, 24.5, 25.0, with windows of 2 and 3 in place of 5 and 34 and a 2-bar average in place of the 5-bar one. The AO reads 0.50 and then 0.08 on the last two bars, and AC = 0.08 − (0.50 + 0.08) / 2 = −0.21.

07Built in Assay

The same study written in Assay, Bentrix’s script language, and drawn by Bentrix itself as the script’s graph: each block is one step of the formula. On the ladder the steps stand in the script’s order, one a row; on the board each wire carries a value from the block that gives it to the block that reads it, left to right. The script computes exactly what the study computes — Bentrix checks the two against each other, candle by candle.

THE SCRIPT’S GRAPH
//@version=6
indicator("Accelerator Oscillator")
fastLength = input.int(5, "Fast")
slowLength = input.int(34, "Slow")
signalLength = input.int(5, "Signal")
// The Awesome Oscillator: the short average of the bar's middle price, less the long one...
ao = ta.sma(hl2, fastLength) - ta.sma(hl2, slowLength)
// ...less its own short average.
ac = ao - ta.sma(ao, signalLength)
plot(ac, "AC", style = plot.style_histogram)
hline(0)

Paste it into the Assay IDE to put it on a chart, or to change it. Looking at the graph is free in every package; editing it as blocks is Plus.

08Readings — what traders look for

Williams read the Accelerator by the colour of its bars and the side of zero they stand on: a run of bars in the rising colour is read as momentum gaining pace, a run in the falling colour as momentum losing it. He asked for fewer bars of one colour when they stood on the side of zero that agreed with them — rising bars above zero — and more when they stood against it.

How its early turn fails. The Accelerator turns before the AO, which turns before the averages. Being first, it is also the most often wrong: every hesitation in a trend turns it.

How the colour counts fail. Williams counted consecutive bars of one colour. Two or three same-coloured bars occur by chance all the time in a line this jagged.

09In different markets and timeframes

The Accelerator turns before the Awesome Oscillator does and is the earliest and noisiest of Williams' studies.

In a steady trend its bars sit close to zero even while price travels far, because it measures the change of momentum and not momentum itself; its largest bars come where a move starts or stops. In a range it changes colour every few bars. On M1 to M15 those changes are too frequent to tell apart from noise; Williams worked on daily bars, where a run of five or more bars of one colour is uncommon enough to be looked at. Its midpoint price ignores opens and closes, so gaps between sessions enter it only through the next bar's high and low.

10With other studies

Read above or below the Awesome Oscillator it is taken from: the AC changing colour while the AO does not is its whole reading.

11What it does not tell you

!

It is the Awesome Oscillator measured against its own recent average: it says whether momentum is gaining or losing pace, and nothing about how much momentum there is or which way price is going. A falling Accelerator above zero belongs to a market that is still rising.

12Inputs and defaults

Accelerator (5, 5)settings card
1Fast period5
2Signal period5
3Slow period34
4TimeframeChart
5Wait for the candle to closeOn
  1. 1
    Fast period — 5The Awesome Oscillator's short average (5).
  2. 2
    Signal period — 5The average of the AO that is subtracted from it (5).
  3. 3
    Slow period — 34Its long average (34).
  4. 4
    Timeframe — ChartThe chart's own by default; any higher one, read on the last closed candle. A finer one is never offered.
  5. 5
    Wait for the candle to close — OnThe value of a higher timeframe is taken only from a candle that has finished.

The settings in use

  • In use5, 34 and 5.

13Limits and common misreadings

Three steps from price: an average, a difference of averages, and a difference from an average of that.

In price units. Its values cannot be compared between instruments, or across years on one instrument whose price has changed much.

14Conditions an alert or a strategy can watch

crosses above 0 eventcrosses below 0 eventis above 0 stateis below 0 statethe histogram turns up eventthe histogram turns down event

Event: the bar it happens on an event happens on one barState: every bar while it holds a state holds on every bar while it lasts

These are the conditions the study itself declares — the same rules the alert editor and the strategy engine read, and the ones the figure's chips show.

15Practise it in the laboratory

Put AO and AC in two panes; replay a trend and note each time AC changes colour while AO does not, and whether the trend then paused or continued.

Open the laboratory

17In Bentrix

  • From the menu: a chart's Indicators button › Bill Williams › Accelerator, or type Accelerator in its search.
  • Its settings: the settings card opens when it is added; its legend's name opens it again.

18From an agent or a program

Two tools reach it. study_values computes it over a workbench’s candles up to the clock — no chart needed — and study_attach puts it on a chart, where it is drawn and saved with the chart ({"chart": "<chart uri>", "kind": "ac"}).

The study, as a chart files it

This is a new Accelerator’s entry — its kind, its calculation, the price it reads and its settings. Change a setting here to read it with other inputs.

{
  "applied": "close",
  "convention": "talib",
  "kind": "ac",
  "settings": {
    "fast": 5,
    "shape": "fast_slow_signal",
    "signal": 5,
    "slow": 34
  }
}

An agent

An agent calls the MCP tool with it:

{
  "name": "study_values",
  "arguments": {
    "bench": "bentrix://lab/\u2026/bench/\u2026",
    "symbol": "EURUSD",
    "timeframe": "H1",
    "limit": 5,
    "study": {
      "applied": "close",
      "convention": "talib",
      "kind": "ac",
      "settings": {
        "fast": 5,
        "shape": "fast_slow_signal",
        "signal": 5,
        "slow": 34
      }
    }
  }
}

A program

A program does the same in its language — bench and market as in the built-in indicators guide:

Python

values = client.study.values(bench, market, "H1", {"applied": "close", "convention": "talib", "kind": "ac", "settings": {"fast": 5, "shape": "fast_slow_signal", "signal": 5, "slow": 34}}, limit=5)
print("times:", values["times"])
for line in values["lines"]:
    print("line:", line["line"])
    print("  newest values:", line["values"])

JSJavaScript

const values = await client.study.values({ bench, symbol: market, timeframe: "H1", study: { "applied": "close", "convention": "talib", "kind": "ac", "settings": { "fast": 5, "shape": "fast_slow_signal", "signal": 5, "slow": 34 } }, limit: 5 });
console.log("times:", values.times);
for (const line of values.lines) {
  console.log("line:", line.line);
  console.log("  newest values:", line.values);
}

C#C#

var values = await client.Study.Values(bench, market, "H1", new Dictionary<string, object?> { ["applied"] = "close", ["convention"] = "talib", ["kind"] = "ac", ["settings"] = new Dictionary<string, object?> { ["fast"] = 5, ["shape"] = "fast_slow_signal", ["signal"] = 5, ["slow"] = 34 } }, limit: 5);
Console.WriteLine($"times: {values!["times"]!}");
foreach (var line in values!["lines"]!.AsArray())
{
    Console.WriteLine($"line: {line!["line"]!}");
    Console.WriteLine($"  newest values: {line!["values"]!}");
}

GOGo

values := must(client.Study.Values(ctx, mcp.StudyValuesArgs{Bench: bench, Symbol: market, Timeframe: "H1", Study: map[string]any{"applied": "close", "convention": "talib", "kind": "ac", "settings": map[string]any{"fast": 5, "shape": "fast_slow_signal", "signal": 5, "slow": 34}}, Limit: mcp.Ptr[int64](5)}))
fmt.Println("times:", at(values, "times"))
for _, line := range at(values, "lines").([]any) {
	fmt.Println("line:", at(line, "line"))
	fmt.Println("  newest values:", at(line, "values"))
}

Java

Object values = client.study.values(new Bentrix.StudyApi.ValuesArgs(bench, market, "H1", obj("applied", "close", "convention", "talib", "kind", "ac", "settings", obj("fast", 5, "shape", "fast_slow_signal", "signal", 5, "slow", 34))).limit(5L));
System.out.println("times:" + " " + at(values, "times"));
for (Object line : (List<Object>) at(values, "lines")) {
    System.out.println("line:" + " " + at(line, "line"));
    System.out.println("  newest values:" + " " + at(line, "values"));
}

C++C++

auto values = client.study.values_(StudyApi::ValuesArgs(bench, market, "H1", Json::Object{{"applied", "close"}, {"convention", "talib"}, {"kind", "ac"}, {"settings", Json::Object{{"fast", 5}, {"shape", "fast_slow_signal"}, {"signal", 5}, {"slow", 34}}}}).limit(5));
std::cout << "times:" << " " << values["times"].dump() << std::endl;
for (const Json &line : values["lines"].arr()) {
    std::cout << "line:" << " " << line["line"].dump() << std::endl;
    std::cout << "  newest values:" << " " << line["values"].dump() << std::endl;
}

Julia

values = client.study.values(bench, market, "H1", Dict{String,Any}("applied" => "close", "convention" => "talib", "kind" => "ac", "settings" => Dict{String,Any}("fast" => 5, "shape" => "fast_slow_signal", "signal" => 5, "slow" => 34)); limit = 5)
println("times:", " ", values["times"])
for line in values["lines"]
    println("line:", " ", line["line"])
    println("  newest values:", " ", line["values"])
end

RR

values <- client$study$values(bench, market, "H1", list(applied = "close", convention = "talib", kind = "ac", settings = list(fast = 5, shape = "fast_slow_signal", signal = 5, slow = 34)), limit = 5)
cat("times:", format(values$times), "\n")
for (line in values$lines) {
  cat("line:", format(line$line), "\n")
  cat("  newest values:", format(line$values), "\n")
}

RRust

let values = client.study().values(mcp::StudyValuesArgs::new(bench.clone(), market.clone(), "H1", serde_json::json!({"applied": "close", "convention": "talib", "kind": "ac", "settings": {"fast": 5, "shape": "fast_slow_signal", "signal": 5, "slow": 34}})).limit(5))?;
println!("times: {}", values["times"]);
for line in values["lines"].as_array().into_iter().flatten() {
    println!("line: {}", line["line"]);
    println!("  newest values: {}", line["values"]);
}

Reading the answer

  • times — the candles’ open times, in milliseconds since 1970 (UTC), oldest first.
  • lines — one entry per line, in this order, each with its line name and its values; values[i] belongs to the candle at times[i].
  • The last value is the candle at the clock’s, which may still be forming: it changes until that candle closes, as on the chart. Nothing after the clock is ever computed.
  • null is a candle with no value yet — the warm-up, about 1 × the period at the start of the history.
  • Its fixed levels, drawn on the chart: [0.0].
lineWhat it is
Mainthe indicator's own value

In a strategy

Filed under a key of your choice in a strategy document’s studies — here ac: {"ac": {"applied": "close", "convention": "talib", "kind": "ac", "settings": {"fast": 5, "shape": "fast_slow_signal", "signal": 5, "slow": 34}}} — its rules can name:

WriteWhat it is
acits main line, as a value in a compare
{"cond": "ac:level.cross_up:0"}a condition it declares itself
{"cond": "ac:level.cross_down:0"}a condition it declares itself
{"cond": "ac:level.above:0"}a condition it declares itself
{"cond": "ac:level.below:0"}a condition it declares itself
{"cond": "ac:histogram.turns_up"}a condition it declares itself
{"cond": "ac:histogram.turns_down"}a condition it declares itself

19Sources

  1. Williams, Bill. New Trading Dimensions. Wiley, 1998.

Bentrix 0.1.382Every number, name and default on these pages is read from the application itself.What is comingWhat changed