Rainbow moving average

Rainbow MA
Indicator

TrendOn the price chartFree on ChartLabs

The rainbow moving average draws ten simple averages, each one an average of the line under it, starting from the close.

Created by Mel Widner, 1997. Reviewed by the ChartLabs team, updated Nov 2026.

Example market1hIndicatorsAtlas AIRainbow MAchartlabs.co/charts
Atlas reads it

SMA 1 is below SMA 2 (64,980.0).

SMA 1 64,980.0 · SMA 2 65,219.8 · SMA 3 65,473.5 · SMA 4 65,692.4

Atlas reads it

SMA 1 is below SMA 2 (64,980.0).

SMA 1 64,980.0 · SMA 2 65,219.8 · SMA 3 65,473.5 · SMA 4 65,692.4

Illustration on simulated data.

Rainbow moving averageWhat is the Rainbow MA indicator?

The first band is a simple average of the source. The second band is a simple average of the first band, the third averages the second, and so on through ten bands. Mel Widner published the stack in Rainbow Charts (Technical Analysis of Stocks & Commodities, July 1997).

The default length is 2, which is short, so the bands stay near price. Before the length is filled, each band averages the bars it has so far. Two closes, 10 then 14, put the first band at 10 and then 12, the second at 10 and then 11, and the third at 10 and then 10.5.

The source defaults to the close. The ten lines are 1 px, from red #F44336 through purple #9C27B0, on the price chart. There is no separate signal line.

Length 2

The default is two bars, not a long trend length. A longer length spreads the bands out.

Partial windows

On the first bar every band equals the close. They separate only as later bars arrive.

Rainbow MA signalsFive patterns to know.

1Bullish lean

Bands stacked upward

The faster bands are above the slower ones. Recent closes have been higher than the stack.

2Bearish lean

Bands stacked downward

The faster bands are under the slower ones.

3Inconclusive

Bands pinched

The ten lines sit on top of each other. Price has been quiet, or the length is very short.

4Inconclusive

Bands fanned

Each average has had time to fall behind the one inside it. The fan is wide.

5Inconclusive

Price through the stack

The close has moved from one side of the ten lines to the other. The slower bands follow later.

Rainbow MA formulaHow it is calculated.

SMAk=SMA(SMAk−1,n)
STEP 1

Average the close

The first band is the simple average of the last n closes, or of every close so far if fewer than n are loaded. The default n is 2.

STEP 2

Average that line

Each next band is the same average of the band under it. Ten bands in all.

STEP 3

Read the example

Closes 10 then 14. The first three bands go from 10 to 12, from 10 to 11, and from 10 to 10.5.

Rainbow MA settingsEvery setting, explained.

SettingDefaultRangeWhat it changes
Length21 to 2,000The length of every band. The Signal lens changes this. The default is short.
SourceCloseAny price, or volumeThe series the first band averages.
Bands#F44336 #FF5722 #FF9800 #FFC107 #FFEB3B #8BC34A #4CAF50 #009688 #2196F3 #9C27B0FixedTen lines, 1 px, red through purple, on the price chart.
Setting
Length
Default
2
Range
1 to 2,000
What it changes
The length of every band. The Signal lens changes this. The default is short.
Setting
Source
Default
Close
Range
Any price, or volume
What it changes
The series the first band averages.
Setting
Bands
Default
#F44336 #FF5722 #FF9800 #FFC107 #FFEB3B #8BC34A #4CAF50 #009688 #2196F3 #9C27B0
Range
Fixed
What it changes
Ten lines, 1 px, red through purple, on the price chart.
281 bars in each average
70,20866,82563,44360,06164,803.7

Drag to see how the setting changes the lines and how many signals you get. Illustration on simulated data.

Rainbow MA strategiesUse it in 3 setups.

Price above a rising stack

Whilethe close is above the bandsand the fast bands lead

The short averages are pulling away upward. Traders often want the close on that side of the stack. The bands are still averages of what already printed.

Price under a falling stack

Whilethe close is under the bands

The same picture the other way. The slowest band is the last to turn.

A pinch before a fan

Whilethe ten lines overlapa later fan is a change from a quiet stretch

A pinch says the averages agree. It does not say which way the next fan will open.

Test a rule in the Strategy TesterFree with 1 year of history. Past results do not guarantee future results.

Rainbow MA mistakesCommon mistakes.

Treating the outer band as a price target

The tenth band is an average of an average. It lags. It is not a measured move.

Leaving the length at 2 and expecting a slow trend line

Length 2 hugs the close. Raise the length if you want the bands to separate on a trend.

Counting ten crosses as ten signals

The bands are the same average stacked. They cross price together, a little apart. They are one stack, not ten independent tools.

Rainbow MA combinationsPair it with these.

Rainbow MA FAQQuestions traders ask.

What are the rainbow settings?

Length 2 and source close. All ten bands share that one length.

Why is the default length 2?

That is the engine default. It keeps the bands close to the close. It is not a recommended trend length.

What is the two-bar example?

Closes 10 then 14. The first band goes from 10 to 12, the second from 10 to 11, the third from 10 to 10.5. Each band averages the line under it, and the first bar has only one value.

How many lines are there?

Ten. Colours run from #F44336 (red) to #9C27B0 (purple).

Do the bands start only after 20 bars?

No. From the first bar, each band averages what it has seen. With length 2 they are full on the second bar.

Is the outer band slower?

Yes. Each band averages the one inside it, so the tenth line moves last.

Does it repaint?

No. A closed bar's source stays. The live bar's close can still move, so the bands move with it until the bar closes.

Who created it?

Mel Widner, Rainbow Charts, Technical Analysis of Stocks & Commodities, July 1997.

Related indicatorsMore trend tools.

All trend indicators

Try Rainbow MA on a live chart.
Free. No download.

Works in your browser and on iPhone too.

Example market1h
Rainbow