Rainbow MA
Indicator
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.
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
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.
Bands stacked upward
The faster bands are above the slower ones. Recent closes have been higher than the stack.
Bands stacked downward
The faster bands are under the slower ones.
Bands pinched
The ten lines sit on top of each other. Price has been quiet, or the length is very short.
Bands fanned
Each average has had time to fall behind the one inside it. The fan is wide.
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.
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.
Average that line
Each next band is the same average of the band under it. Ten bands in all.
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.
| Setting | Default | Range | What it changes |
|---|---|---|---|
| Length | 2 | 1 to 2,000 | The length of every band. The Signal lens changes this. The default is short. |
| Source | Close | Any price, or volume | The series the first band averages. |
| Bands | #F44336 #FF5722 #FF9800 #FFC107 #FFEB3B #8BC34A #4CAF50 #009688 #2196F3 #9C27B0 | Fixed | Ten 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.
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
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
The same picture the other way. The slowest band is the last to turn.
A pinch before a fan
A pinch says the averages agree. It does not say which way the next fan will open.
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 + SMA
One simple average is the first band on its own. The rainbow repeats that average nine more times.
Rainbow MA + EMA
An EMA weights the newest close more. These bands are plain averages.
Rainbow MA + VIDYA
VIDYA changes its speed from how straight the closes have been. The rainbow's length stays fixed.
Rainbow MA + ATR
ATR shows whether a fan is wide in price, or only looks wide because the bands are short.
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 indicatorsTry Rainbow MA on a live chart.
Free. No download.
Works in your browser and on iPhone too.