Trend indicators

Rainbow Oscillator: Formula, Rainbow Bandwidth and a Daily Bitcoin Example

Mel Widner’s oscillator turns his ten rainbow averages into two readings, the distance of the close from their mean and the spread of the bands, both scaled by the range of recent closes; here is how each is computed and what they showed on Bitcoin in 2026.

· Founder of PatternsWizard
Checked 6 min read
Rainbow Oscillator(2, 10)
On this page
  1. How the Rainbow Oscillator is calculated
  2. How to read it
  3. The oscillator on a real chart
  4. Trading rules
  5. Does it work?
  6. Frequently asked questions

The Rainbow Oscillator is the oscillator version of Mel Widner’s Rainbow Charts, introduced with them in the July 1997 issue of Technical Analysis of Stocks and Commodities. It starts from the same ten moving averages, each a 2-bar average of the one before, and asks two questions. How far is the close from the middle of the ten lines? And how far apart are the lines? Both answers are divided by the range of recent closes, so the readings can be compared over time and across markets.

Rainbow Oscillator and bandwidth on daily Bitcoin

87,39672,59857,800093.6−77.3Feb 21, 2026Jun 25, 2026Oct 28, 2026
  • Price, daily candles (hollow up, filled down)
  • Bandwidth, spread of the 10 averages (solid line, second color)
  • Rainbow Oscillator, close minus the average of the 10 lines
Rainbow Oscillator(2, 10) on Bitcoin, daily, February 21, 2026 to October 28, 2026. Illustration of how the indicator reads, not a backtest.

How the Rainbow Oscillator is calculated

Infront documents both readings. First build the ten rainbow averages, as on our Rainbow Charts page. The oscillator is 100 times the gap between the close and the average of the ten lines, divided by the range of the recent closes, the highest minus the lowest. The rainbow bandwidth is 100 times the gap between the highest and the lowest of the ten lines, divided by the same range.

The two readings of the Rainbow Oscillator

CloseOscillatorclose minus the averageof the ten linesBandwidthhighest line minusthe lowest lineRange ofrecent closesBoth readings are divided by that range
Schematic, not market data.Both readings use the same divisor, so they can be read on one scale.

Infront gives the range of closes over the current bar and the ten before it; LuxAlgo describes a lookback commonly set to 10 and notes that implementations vary. The chart on this page uses the last 10 closes. Infront states that the oscillator fluctuates between −100% and +100%; LuxAlgo describes a scale of roughly ±100. In our window the readings stayed well inside it.

How to read it

ReadingWhat it says
Oscillator above zeroThe close is above the average of the ten rainbow lines
Oscillator below zeroThe close is below that average
Oscillator far from zeroThe close has moved a large part of its recent range away from the bands
Bandwidth risingThe ten lines are spreading: the move is gaining speed
Bandwidth falling or lowThe lines are bunching up: the move is slowing or price is flat

The oscillator on a real chart

The full chart below the introduction covers daily Bitcoin from February 21 to October 28, 2026. The oscillator peaked at 78.02 on August 19 and reached its low of −65.48 on March 27. It was above zero on 130 of the 250 days (52%) and changed sign 66 times, about once every four days. The bandwidth went from 8.75 on June 11 to 81.83 on August 22, the same day the spread of the rainbow lines peaked on our Rainbow Charts chart. On October 28 the oscillator read 13.48 and the bandwidth 24.82.

The frequent sign changes come from the short period: with 2-bar averages, the ten lines span only 11 closes, so the close crosses their average often. The lookback does not change the sign, since it only sets the range that divides the gap; the period does. We recomputed the oscillator on the same days with longer periods:

Sign changes of the Rainbow Oscillator in 250 days, by period

Period 2, the default66, peak 78.02Period 342, peak 82.68Period 438, peak 132.11Period 522, peak 212.17
Our computation; the inputs and the method are in the text.Daily Bitcoin, February 21 to October 28, 2026, ten averages and a lookback of 10 closes; the text adds the highest reading of the oscillator in the window. A change of lookback leaves the count unchanged.

Going from a period of 2 to 5 cut the sign changes from 66 to 22, but it also stretched the scale: with a period of 4 the oscillator reached 132.11 on August 31, and with 5 it reached 212.17, well beyond the ±100 that Infront states. The bound only holds for short periods, when the ten lines stay inside the range of recent closes.

Trading rules

Infront lists no basic trading system for the oscillator. cTrader does give rules: a possible buy when the oscillator crosses above its moving average, preferably out of oversold territory, a possible sell on the cross below, divergences between price and the oscillator, and a stop beyond the recent swing. Its version is built differently, though: it averages the gap between the price and each of its moving averages, with nine levels by default, and is not divided by the range of closes. The same name covers two indicators, and readings from one do not carry over to the other.

Does it work?

We have no long-run measurement of the Rainbow Oscillator: our bench tests chart patterns detected by rule against random entries, not indicators (see our methodology). One market over eight months is an illustration, not a test.

For other oscillators that measure the distance of price from an average or the quality of a trend, see the Detrended Price Oscillator, Polarized Fractal Efficiency, the Disparity Index and the Trend Intensity Index, or the full list of trend indicators.

Frequently asked questions

What is the Rainbow Oscillator?

An oscillator by Mel Widner that measures the distance between the close and the average of his ten rainbow moving averages, divided by the range of recent closes. A second line, the rainbow bandwidth, measures the spread of the ten averages.

How is the Rainbow Oscillator calculated?

RO = 100 × (close − average of the ten rainbow lines) / (highest close − lowest close over the lookback). The ten lines are recursive 2-bar averages of the close.

What does the rainbow bandwidth show?

How far apart the fastest and slowest rainbow lines are, relative to the recent range. It rises when price moves fast in one direction and falls when the move slows down.

What are the default settings?

Infront lists a period of 2 with ten averages. The range of closes is taken over about ten bars; platforms differ by one bar.

Does the Rainbow Oscillator predict reversals?

It is built from averages of past closes, so it describes the move that has happened. cTrader suggests crosses of the oscillator and its moving average and divergences as signals; we found no documented test showing that its readings predict turns.

Sources

  1. Infront, Rainbow Oscillator (indicator documentation)
  2. cTrader Help, Rainbow Oscillator
  3. LuxAlgo, Rainbow Oscillator
, Founder of PatternsWizard

Passionate about finance, quantitative trading and data analysis. Amaury built the PatternsWizard test bench, which detects each pattern on full price history and measures what happened next against random entries.

PatternsWizard tests chart and candlestick patterns on full market history, against random entries. How we test patterns.

179 patterns testedRandom-walk self-test passed

All trend indicators articles