ATMResearch
Join Overfit - free
Overfit cover card on dark navy, kicker 'Rainbow moving average': the headline 'Rainbow spacing is a coin flip.' over the line 'Ratio spacing beat even spacing in 87 of 165 matched tests. The fastest line decides.', with a corner badge reading '11 futures · 2005-2026'.
  1. Overfit/
  2. Research/
  3. Rainbow Moving Average Settings: Spacing Is a Coin Flip in 165 Tests

October 29, 2026

Rainbow Moving Average Settings: Spacing Is a Coin Flip in 165 Tests

Share

10 min read

Written by Ali Casey, founder of StatOasis and AlgoChef, creator of the Algo Trading Masterclass (ATM), with over 10 years of experience building systematic trading tools - building algorithmic strategies, testing ideas with data, and teaching traders how to build structured, portfolio-based trading workflows.

Published October 29, 2026 · Method

← Back to Research
Table of contents▾
  • TL;DR
  • Why would you space a rainbow differently?
  • How we tested
  • Is the classic rainbow really crowded at the top?
  • Which pair actually ends an alignment?
  • Does ratio spacing reduce false signals?
  • Does ratio spacing trade better on the classic 10-to-50 stack?
  • Does spacing matter once the first and last lines are matched?
  • Is the Fibonacci ribbon (5, 8, 13, 21, 34) any better?
  • What rainbow moving average settings actually work?
  • Does the rainbow work on the short side?
  • Does it beat doing nothing?
  • The verdict, and the honest limits
  • What this means for you
  • Methodology: how this data was generated
  • Disclaimer
  • Methodology
  • FAQs

The short version

I tested how to space the five lines of a rainbow moving average on 11 futures and SPY, 2005 to 2026. Ratio spacing made the stack noisier (more false flips in 138 of 165 matched comparisons) and won on return to drawdown in 87 of 165 on the pullback signal, a coin flip. The start matters instead: on that signal, every ratio stack starting at 8 to 12 bars, with a step ratio of 1.3 to 1.8, had a positive median return to drawdown.

Methodology & risk note: Backtested study of 11 futures and SPY daily bars, 2005-2026, simple moving averages, Execution rule v2 (signal at the close, fill at the next open), frictionless. Results are hypothetical and not investment advice, past patterns don't guarantee future results. Full method and disclaimer below.

TL;DR

  • Spacing is a coin flip for results. Across 15 matched pairs of evenly spaced and ratio-spaced stacks on 11 futures, the ratio stack had the better return to drawdown in 87 of 165 comparisons on the pullback signal and 70 of 165 on the alignment signal, both traded long and short.
  • Ratio spacing adds noise. It produced more false alignment flips (an alignment that dies inside 5 bars) in 138 of 165 comparisons. On the classic 10-to-50 stack: 3.03 a year against 2.37, higher in 10 of 11 markets.
  • The start decides. Every ratio stack starting at 8 to 12 bars with a step ratio of 1.3 to 1.8 had a positive median return to drawdown on the pullback signal (18 of 18 cells, median 0.84). Evenly spaced stacks with the same starts scored a median 0.82.
  • On the classic stacks, the short side does not pay in the typical market. On the 10-to-50 stacks, long trades had a median return to drawdown of 0.68 to 1.71. Short trades ran -0.02 to -0.27, with only 4 to 5 of 11 markets profitable.
  • It is a trend filter, not a system. Median return to drawdown near 1 over 21 years, before costs. On SPY the long pullback signal netted $21,686 to $22,963, inside the spread of a random-entry control.

Return to drawdown (Ret/DD) is net profit divided by the worst peak-to-trough loss, both in dollars. Above 1 means the strategy made more than its worst drawdown.

Why would you space a rainbow differently?

If you've ever put a rainbow moving average on a chart, you've seen the classic layout: evenly spaced lines, like 10, 20, 30, 40, 50. Five lines, ten bars apart. Even spacing goes back to Mel Widner's Rainbow Charts in Technical Analysis of Stocks & Commodities, July 1997, built from ten recursively smoothed averages whose lag, in his words, "increases one half period per averaging pass". Even steps of lag. Linear spacing. The best-known ribbon, the Guppy Multiple Moving Average, spaces its twelve exponential averages evenly inside each of its two groups too.

I looked at that default and thought it was a math error. Going from 10 to 20 doubles the length. Going from 40 to 50 adds a quarter. The jumps shrink as you climb, so the first jump is 4x the last in relative terms. The bottom of the stack is a canyon. The top is two lines wearing different colours.

The fix looked obvious. Space the lines by one constant ratio instead: 10, 15, 22, 33, 50, every step +49.5%. Same first line, same last line, even gaps all the way up. That is how a Fibonacci moving-average ribbon already works, since consecutive Fibonacci numbers grow by about 1.618.

So I fixed it, and I tested the fix on 11 futures markets and 21 years of data. The fix made it noisier, and no better.

Think of the rainbow as a smoke detector system. Each pair of neighbouring lines is a detector, and an alignment ends the moment any one of them goes off. The fastest pair is the detector mounted next to the toaster. Ratio spacing moves it closer.

Prefer to watch? The video walks through the same study.

I Fixed the Rainbow Moving Average. It Got Noisier: the same study, walked through on video

Want the Rainbow as code? The indicator, its StrategyQuant X signal blocks, the EasyLanguage functions and an illustrated guide are a free download in the Bonuses channel of the StatOasis community.

How we tested

Here is exactly what sits behind every number below.

  • Markets: 11 futures (Euro FX 6E, E-mini S&P 500 ES, gold GC, Japanese yen JY, natural gas NG, E-mini Nasdaq NQ, RBOB gasoline RB, sugar SB, E-mini Dow YM, 10-year Treasury note ZN, wheat ZW), one contract each. SPY as an ETF view, $35,000 in whole shares. Crude oil was left out because its back-adjusted price series crosses zero inside the window.
  • Window: 2005-01-03 to 2026-08-20, 21.63 years, the same bars for every market and every stack.
  • The rainbow: five simple moving averages. An exponential version appears as a check on the 10-to-50 stacks only.
  • Stacks tested: evenly spaced 10, 20, 30, 40, 50, ratio-spaced 10, 15, 22, 33, 50, the round-ratio 10, 15, 23, 34, 51, and the Fibonacci 5, 8, 13, 21, 34. Then 15 matched pairs, each an evenly spaced and a ratio-spaced stack with the same first and last line (starts 5 to 20), and a sweep of ratio stacks over 7 starts and 11 step ratios.
  • Two signals, long and short mirrored: Align holds a trade while all five lines are in order and exits at the next open after the order breaks. Pullback waits for the order to be intact and the close to dip back below the fastest line (above it for shorts), buys the next open, and exits the same way.
  • Execution: Execution rule v2. The signal is read at the close, the trade fills at the next open, one position at a time. Frictionless: no commission, no slippage.
  • Scores: return to drawdown, profit factor, win rate and trade count, with the median taken across the 11 futures so no single market carries a verdict.

Defined: ATR, or average true range, is a standard gauge of recent daily movement. A gap of 1 ATR would mean two lines sit a typical day's range apart. A false flip is a full alignment, all five lines in order, that ends inside 5 bars.

The pullback rule on one real ES trade: all five lines in order, a close back below the 10-day line, buy the next open, sell the next open after the order breaks. One trade to show the rule, not proof.

Is the classic rainbow really crowded at the top?

Yes. The geometry claim holds. On the evenly spaced stack, the gap between neighbouring lines shrinks from 0.66 ATR at the bottom pair to 0.42 ATR at the top. The 40 and 50 lines move almost as one: their daily changes correlate at 0.90.

StackGap in ATR, pair 1 (fastest)Pair 2Pair 3Pair 4 (slowest)Daily-change correlation, top pair
Even, 10-20-30-40-500.660.540.470.420.90
Ratio, 10-15-22-33-500.380.440.570.710.81
Fibonacci, 5-8-13-21-340.320.410.510.660.79

Mean of the 11 futures, simple moving averages.

Even spacing crowds the top (0.42 ATR). Ratio spacing crowds the bottom (0.38 ATR).

Ratio spacing does exactly what it promises at the top: the slowest pair opens to 0.71 ATR. The catch is where it gets that room. It takes it from the bottom, where the fastest pair closes from 0.66 to 0.38 ATR.

Which pair actually ends an alignment?

The bottom one, three times out of four. On the evenly spaced stack, the 10 and 20 lines crossing ended 74.5% of all alignments. The crowded top pair ended 5.7%, and it was the most frequent breaker in 0 of 11 markets.

StackShare of alignment breaks, pair 1Pair 2Pair 3Pair 4Pair 1 crossings a year
Even, 10-5074.5%12.4%7.4%5.7%13.22
Ratio, 10-5078.7%11.5%6.6%3.2%18.68
Fibonacci, 5-3483.1%8.9%5.5%2.5%34.87

So the redundant top is real, and it rarely ends an alignment. The canyon at the bottom is the detector that does almost all the work, and ratio spacing moves it next to the toaster: the fastest pair crossed 18.68 times a year instead of 13.22, more often in 11 of 11 markets.

The top pair rarely ends an alignment. The bottom pair ends most of them.

Does ratio spacing reduce false signals?

No. It adds them. The ratio-spaced 10-to-50 stack had 3.03 false flips a year against 2.37 for the even stack, 28% more, and it had fewer in just 1 of 11 markets.

StackAlignments a yearFalse flips a yearShare of completed alignments that die inside 5 barsMedian alignment (bars)Time aligned
Even, 10-507.632.3731.1%10.644.6%
Ratio, 10-509.053.0333.5%9.043.0%
Fibonacci, 5-3414.806.5644.3%5.038.9%
Even, 10-50, EMA6.961.0014.4%19.072.4%
Ratio spacing flipped falsely more often in 10 of 11 markets. Wheat was the exception.

This is not one lucky comparison. Across all 15 matched pairs and 11 futures, 165 comparisons in total, the ratio stack had more false flips in 138 and fewer in 20. The median went from 2.36 a year to 2.82.

The Fibonacci ribbon is the extreme case. Its fastest line is 5 bars, and 44.3% of its completed alignments were dead inside 5 bars.

Does ratio spacing trade better on the classic 10-to-50 stack?

On the pullback signal, it looks like it. The ratio stack beat the even stack on return to drawdown in 9 of 11 markets, with a median of 1.06 against 0.82.

StackSignal, both sidesTradesMedian Ret/DDMedian profit factorMarkets profitable
Even, 10-50Align1,8090.671.157 of 11
Ratio, 10-50Align2,1470.461.098 of 11
Even, 10-50Pullback1,5560.821.268 of 11
Ratio, 10-50Pullback1,8671.061.279 of 11
Fibonacci, 5-34Align3,516-0.200.954 of 11

Medians across the 11 futures, one contract, frictionless.

On ES, the long pullback trade shows the same tilt. The even stack made $103,712 on 89 trades with a $29,662 maximum drawdown (Ret/DD 3.50). The ratio stack made $91,875 on 112 trades with a $25,425 drawdown (Ret/DD 3.61) and a 55.4% win rate against 48.3%.

I'd have stopped here and called it a win. That is the trap. This is one pair of settings, and the ratio stack is also faster than the even one: its inner lines are 15, 22 and 33 instead of 20, 30 and 40. Spacing and speed moved together, so this comparison cannot tell you which one did the work.

Does spacing matter once the first and last lines are matched?

Not consistently. That is what the 15 matched pairs are for: each pair shares its first and last line, so the speed gap shrinks to the three inner lines. Across the 165 comparisons in each signal-and-side cell, the ratio stack won between 63 and 88 times. A coin flip wins half. We ran no significance test on these counts: coin flip here means the ratio stack's wins sat near half, never far from it.

SignalSideRatio stack better Ret/DD (of 165)Median Ret/DD, evenMedian Ret/DD, ratio
AlignLong630.840.83
AlignShort88-0.08-0.04
AlignBoth700.460.34
PullbackLong840.620.55
PullbackShort88-0.06-0.05
PullbackBoth870.670.48
Six signal and side cells, 165 comparisons each: the ratio stack won 38% to 53% of the time, never consistently ahead.

The 10-to-50 pair that looked so good is the friendliest of the 15. On the pullback signal traded both ways, the ratio stack won 9 of 11 markets there. Across the other 14 pairs it won between 3 and 8.

The most flattering of fifteen comparisons. Show only that one and you can sell a setting.

Is the Fibonacci ribbon (5, 8, 13, 21, 34) any better?

No. It is the noisiest of the four named stacks. With 6.56 false flips a year and a median alignment of 5.0 bars, trading its alignment both ways had a median return to drawdown of -0.20 and only 4 of 11 futures profitable, on 3,516 trades.

Its spacing is fine. Its step ratios run from 1.600 to 1.625, about as close to one constant ratio as a stack gets. It does start at 5 bars, the fastest of the named stacks: the smoke detector inside the toaster.

That points at the real setting.

What rainbow moving average settings actually work?

Where the stack starts. In the sweep of ratio stacks (7 starts from 5 to 25, 11 step ratios from 1.2 to 2.2), the pullback signal traded both ways had a positive median return to drawdown in every one of the 18 cells with a start of 8 to 12 bars and a ratio of 1.3 to 1.8.

Region (pullback, both sides)CellsLowest median Ret/DDMedian of the cellsMarkets profitable
Ratio stacks, start 8 to 12, ratio 1.3 to 1.8180.200.84at least 7 of 11 (median 9)
Ratio stacks, starts outside 8 to 120.43
Evenly spaced stacks, start 8 to 12210.140.82
The stable region: start 8 to 12, ratio 1.3 to 1.8. All 18 cells positive, median 0.84.

Evenly spaced stacks with the same starts scored a median 0.82 against 0.84. The start, not the spacing, puts a stack in the region.

False flips follow both knobs smoothly. A stack starting at 10 bars goes from 7.00 false flips a year at a ratio of 1.2 to 2.71 at 1.5 and 0.92 at 2.0. Start at 5 with a ratio of 1.2 and you get 17.95 a year. Fewer false flips did not mean better trading, though: the best cells in the heatmap are not the quietest ones. The wide stacks are the calm ones, and the sweep cannot say whether width or slowness does it.

This is the shape of answer worth testing further: a broad plateau where all 18 settings had a positive median, not one peak that happened to. It is still in-sample, so the next check is data it has never seen. It is the same test we put any strategy through before trusting a backtest.

Does the rainbow work on the short side?

Not on the simple-average 10-to-50 stacks. There, every long cell had a positive median return to drawdown and every short cell sat at or below zero.

StackSignalLong median Ret/DDLong markets profitableShort median Ret/DDShort markets profitable
Even, 10-50Align1.718 of 11-0.025 of 11
Even, 10-50Pullback0.738 of 11-0.214 of 11
Ratio, 10-50Align0.689 of 11-0.045 of 11
Ratio, 10-50Pullback1.339 of 11-0.275 of 11
Long trades carried every positive median. Short trades sat between -0.02 and -0.27.

Two other stacks did better short: the Fibonacci alignment short had a median of 0.56 and the evenly spaced EMA alignment short 0.31, each with 6 of 11 markets profitable. Neither is enough to build on alone.

On ES the gap is blunt. The even stack's alignment signal made $83,275 long and lost $18,750 traded both ways. The study did not isolate why the short side fails on these two stacks. It shows that it did, on these markets, over this window.

On these two stacks, the side you trade moved the median far more than the spacing did.

Does it beat doing nothing?

Not clearly. We ran the two standard baselines on every market over the same window. One ES contract bought and held made $287,737.50, nearly three times the best ES rainbow result above ($103,712). A random-entry control on ES, firing as often as the study's median variant and holding 14 bars, averaged $57,538.75 (sd $28,936.54) across 10 seeds. The even stack's long pullback trade, at $103,712, sits more than one of those spreads above the control's average and less than two. Ahead of it, but by less than a decisive margin.

On SPY it is closer still. The long pullback signal made $21,686 (even) and $22,963 (ratio). The random control averaged $17,417.45 with a spread of $9,617.08, so both sit inside it.

The verdict, and the honest limits

The rainbow's critics are right about the geometry. The evenly spaced stack does crowd its top: 0.42 ATR between the 40 and 50 lines, a 0.90 correlation. Ratio spacing does fix that.

They are wrong that fixing it pays. The top pair ended 5.7% of alignments. The ratio 10-to-50 stack that fixes it narrows the bottom gap to 0.38 ATR. Across all 15 matched pairs, ratio stacks had more false flips in 138 of 165 comparisons and won on return to drawdown about half the time. What moved results was where the stack starts: starts of 8 to 12 bars, with ratios of 1.3 to 1.8, formed a plateau where every cell had a positive median return to drawdown.

Now the limits, because a study that hides them isn't worth trusting.

  • Frictionless. No commission, no slippage. The ratio 10-to-50 stack trades 19% more often (2,147 trades against 1,809 traded both ways), so costs would count against it.
  • One exit, no stop. Every trade exits when the alignment breaks. These results measure spacing inside this rule set only.
  • Speed and spacing overlap. The ratio 10-to-50 stack is faster than the even one, which is why the matched pairs and the sweep exist. The matched pairs fix the first and last line, not the three inner ones, so they narrow the speed difference without removing it. No conclusion here rests on the 10-to-50 comparison alone.
  • The start moves the whole stack. In the sweep, changing the fastest period moves all five lines with it. "Set the fastest line" means set the speed of the whole stack through its first line, not that the first line works alone.
  • No significance test. The 165-comparison counts are reported as counts. Calling them a coin flip describes where they sit (63 to 88 of 165), not a statistical test.
  • Eleven futures and SPY, 21 years. Crude oil was excluded. The window covers 2008, 2020 and 2022, but it is one history.
  • The returns are thin. A median return to drawdown near 1 over 21 years means the typical market made about one worst drawdown of profit in two decades, before costs. The alignment is a trend filter, not a finished system.

What this means for you

  1. Set the fastest line first. With a start of 8 to 12 bars and a step ratio of 1.3 to 1.8, every tested ratio stack landed in the stable region. That one number matters more than how you space the other four.
  2. Pick the spacing second. Neither spacing led consistently. Even or ratio, the ratio stack won 63 to 88 of 165 matched comparisons, depending on signal and side. If you want fewer false flips, even spacing had fewer in 138 of 165 comparisons.
  3. Don't trade the 5-bar Fibonacci alignment both ways. Long and short together, its median return to drawdown was -0.20 across the futures, and 44.3% of its completed alignments died inside 5 bars.
  4. Favour the long side. On the simple-average 10-to-50 stacks, every short median sat at or below zero across these 11 futures. Test the short side hard before you trust it.
  5. Treat it as a filter. Put the rainbow in front of an entry and exit you have tested on their own, and check the result against a random-entry control before you trust it.

The rainbow isn't magic. It's a ruler for trend, and the mark that mattered most here is where you start. If you want the next study like this one, the full sweep and the honest limits, join The Overfit newsletter at StatOasis.com/Overfit.

Methodology: how this data was generated

This is a backtest, not live trading results. Every number comes from our in-house research engine, run over the full price history of each market, not from third-party summaries.

  • Data: daily OHLC bars for 11 futures (6E, ES, GC, JY, NG, NQ, RB, SB, YM, ZN, ZW), one contract each at the engine's big point value, and SPY at $35,000 in whole shares. Crude oil (CL) was excluded: the engine refuses a non-positive price, and the back-adjusted series crosses zero inside the window.
  • Window: 2005-01-03 to 2026-08-20 for every market and stack. Moving averages warm up on earlier bars, so every stack trades the same bars.
  • Stacks: simple moving averages throughout, with exponential rows on the 10-to-50 stacks only. Periods round half up to whole bars.
  • Signals: align (in while all five lines are in order) and pullback (order intact, close back through the fastest line), long and short mirrored exactly.
  • Execution rule v2: the signal is read at a bar's close and fills at the next open. The exit is ordered at a close and fills at the next open. One position at a time.
  • Scores: net profit divided by maximum drawdown (both in dollars), profit factor, win rate and trade count. Medians are taken across the 11 futures, one value per market.
  • Frictionless: no commission or slippage. Real costs reduce every result shown, more so for the faster stacks.
  • Baselines: buy-and-hold and a frequency-matched random-entry control (10 seeds, fixed base seed) for all 12 markets over the same window.

Disclaimer

All results above are derived from historical backtesting and do not represent actual trading results. Backtested performance is hypothetical. Past performance of any pattern does not guarantee future results. Futures trading involves substantial risk of loss. This page is for educational and informational purposes only and does not constitute investment advice. StatOasis is not a registered investment advisor. Nothing here is a recommendation to buy or sell any security or futures contract. Please consult a licensed financial professional before making any investment decision.

Methodology

Data source
Daily OHLC bars for 11 futures (6E, ES, GC, JY, NG, NQ, RB, SB, YM, ZN, ZW; TradingView continuous exports) and SPY, loaded and validated through the StatOasis research engine. Crude oil (CL) was excluded because its back-adjusted series crosses zero inside the window.
Date range
2005-01-03 to 2026-08-20 for every market and every stack (21.63 years); moving averages warm up on earlier bars so every stack trades the same bars.
Entry / exit rules
A rainbow is five simple moving averages. Align: in the trade while MA1 > MA2 > MA3 > MA4 > MA5 (short: the mirror), out at the next open after the order breaks. Pullback: the order is intact and the close falls back below MA1 (short: above MA1), buy the next open, out at the next open after the order breaks. Execution rule v2: signal at the close, fill at the next open.
Sizing
Futures: one contract at the engine's big point value. SPY: $35,000 starting capital, whole shares, no compounding. Frictionless: no commission or slippage.
Overlap mode
Flat-only, one position at a time per variant; a signal while a position is open is ignored.
Look-ahead
Every signal is read from a closed bar and filled at the next bar's open; exits are ordered at a close and fill at the next open. No number depends on information unavailable at the decision.
Minimum sample
50 trades, the engine default. Every headline cell (the 10-to-50 stacks on each future) holds 131 to 202 trades both ways; thinner cells are flagged, not dropped.
Buy-and-hold benchmark
Long from the window's first open to its last close on the study's own sizing, computed for all 12 markets by tools/controls_report.py. ES (one contract): $287,737.50 net, 10.82% CAGR on the $35,000 basis. SPY ($35,000, whole shares): $183,978.48 net, 8.85% CAGR, worst drawdown 56.33% (2009-03-09).
Random control
Frequency-matched seeded coin flip per market, 10 seeds from base seed 20260803, matched to each market's median reliable variant over the same window. ES: 107 entries requested, 14-bar hold, $57,538.75 net (sd $28,936.54). SPY: 108 entries, 14-bar hold, $17,417.45 net (sd $9,617.08). All 12 markets in the facts sheet.
Parameter scopeParameters swept

The study searched the parameter space and reports the spread, not one tuned setting.

Four named stacks (linear 10-50, ratio 10-50, ratio 1.5 from 10, Fibonacci 5-34) plus EMA rows; 15 matched linear vs ratio pairs with the same first and last period (starts 5 to 20, three spans each); and a sweep of ratio-spaced stacks over 7 starts (5 to 25) x 11 ratios (1.2 to 2.2), with evenly spaced stacks over the same starts. Two signals, long, short and both, on 11 futures and SPY. The article reports the spread across that space and the stable region inside it.

Run to v1 of the StatOasis research standard - the rules every study here has to meet before it is published. The version is the study's own: a standard that gained a rule later never reaches back and claims this one met it.

Historical backtest results are not a guarantee of future returns. This content is for educational purposes only and is not investment advice. Hypothetical performance disclosure (CFTC Rule 4.41).

Frequently asked questions

What is a rainbow moving average?⌄

A stack of moving averages of rising length drawn together, usually in rainbow colours, fastest to slowest. When all of them sit in order (fastest on top in an uptrend, at the bottom in a downtrend) traders read the market as trending; when they braid, as chopping. Mel Widner published the original Rainbow Charts in Technical Analysis of Stocks & Commodities in July 1997, built from repeated two-point averages that add lag in even steps.

What are the best rainbow moving average settings?⌄

This sweep found a stable region rather than one best setting. In our sweep of ratio-spaced stacks on 11 futures, every stack starting at 8 to 12 bars with a step ratio of 1.3 to 1.8 had a positive median return to drawdown on the pullback signal (lowest 0.20, median 0.84, at least 7 of 11 markets profitable). Evenly spaced stacks with the same starts did about as well (median 0.82), so pick the fastest line first and the spacing second.

Should rainbow moving averages be spaced evenly or by a ratio?⌄

Neither won consistently. Across 15 matched pairs on 11 futures (165 comparisons), ratio spacing had the better return to drawdown in 87 of 165 on the pullback signal and 70 of 165 on the alignment signal, both traded long and short. The medians were 0.67 even and 0.48 ratio on the pullback signal. It did reliably add noise: more false alignment flips in 138 of 165 comparisons.

What is the 5 8 13 21 EMA strategy?⌄

A Fibonacci ribbon: moving averages at Fibonacci lengths, traded when they line up. We tested the 5, 8, 13, 21, 34 version as a simple-average stack. It was the noisiest of the four named stacks: 6.56 false alignment flips a year, 44.3% of its completed alignments ended inside 5 bars, and trading the alignment both ways had a median return to drawdown of -0.20 with only 4 of 11 futures profitable.

How is a rainbow different from the Guppy Multiple Moving Average?⌄

The Guppy Multiple Moving Average (GMMA) uses twelve exponential averages in two groups, 3 to 15 and 30 to 60, spaced evenly inside each group. A rainbow is one stack, five lines in this study. Both rest on the same alignment idea, and even spacing is what this study found no reason to replace: across 165 matched comparisons, ratio spacing won 87 on the pullback signal and added false flips in 138.

Does the rainbow moving average work for short selling?⌄

Not on the classic stacks. On the 10-to-50 stacks with simple averages, the short side's median return to drawdown across the futures ran from -0.02 to -0.27, with 4 to 5 of 11 markets profitable. The long side ran from 0.68 to 1.71 with 8 to 9 of 11 profitable.

Is the top of the rainbow redundant?⌄

Partly. On the classic 10-to-50 stack the 40 and 50 lines sit only 0.42 ATR apart and their daily changes correlate at 0.90. But the top pair ended only 5.7% of alignments, against 74.5% for the 10 and 20 lines. The bottom pair ends most alignments. The crowded top rarely decides one.

Should I use SMA or EMA for a moving average ribbon?⌄

The exponential version is far calmer. The evenly spaced 10-to-50 EMA stack had 1.00 false flip a year against 2.37 for the simple-average stack, stayed aligned 72.4% of the time against 44.6%, and trading its alignment both ways had a median return to drawdown of 1.44 with 9 of 11 futures profitable. That is one stack, so treat it as a lead to test, not a setting to adopt.

Is the rainbow moving average a complete trading system?⌄

No. Its median return to drawdown sits near 1 over 21 years, meaning the typical market made about one maximum drawdown of net profit in two decades, before any costs. On SPY, the long pullback signal netted $21,686 to $22,963, inside the spread of a random-entry control that averaged $17,417.45 (sd $9,617.08). It is a trend filter to build on, not a finished system.

Read the Strategies, Backtested hub
← Back to Research

Table of contents

  • TL;DR
  • Why would you space a rainbow differently?
  • How we tested
  • Is the classic rainbow really crowded at the top?
  • Which pair actually ends an alignment?
  • Does ratio spacing reduce false signals?
  • Does ratio spacing trade better on the classic 10-to-50 stack?
  • Does spacing matter once the first and last lines are matched?
  • Is the Fibonacci ribbon (5, 8, 13, 21, 34) any better?
  • What rainbow moving average settings actually work?
  • Does the rainbow work on the short side?
  • Does it beat doing nothing?
  • The verdict, and the honest limits
  • What this means for you
  • Methodology: how this data was generated
  • Disclaimer
  • Methodology
  • FAQs

Overfit - the newsletter

Skip the hype. Trust the data.One practical takeaway per issue.

Running a quick security check before this can be sent.

Delivered +2 times a month - when the work is ready, not on a calendar.I'll never sell your address.Unsubscribe in one click, any time.

Related Articles

Back to all research
#122

Robustness Testing: Why Most Traders Fail, and What 36,252 Backtests Say Actually Works

Mar 28, 2025 · 18 min read

Robustness testing is the step between a good backtest and deciding whether to trade it. I measured which checks actually predict what a strategy does in held-back history, then retested the whole thing on 53 markets — where the stack still works, several individual checks turn out to have been overstated threefold, and two of them point the wrong way on some asset classes.

Read more→
#132

Donchian Channel Strategy: I Backtested '40 In, 20 Out' 1,188 Ways on 33 Years of SPY

Jun 6, 2025 · 8 min read

The classic 40-in/20-out channel breakout, re-tested 1,188 ways on 33.4 years of SPY: long-only still made 105.5% frictionless — but the famous 20-day-low exit lost to a plain 20-bar time exit, every unfiltered short entry length lost money under the channel-20 cover and three of the six drew down past 100%, and the edge has decayed every decade.

Read more→
#118

Market Regime: What It Is and What the S&P 500 Did Next in Each of 6 Regimes (32 Years)

Mar 7, 2025 · 8 min read

Every trading day of SPY since late 1993 (after a 200-day warm-up), QQQ, DIA and ES futures was sorted into six market regimes using a 200-day average and two ATRs, decided at the close and measured from the next open. Bull Quiet is the most common regime at 39.5% of S&P 500 days and had the shallowest 20-day dip on all four markets. Regimes are short, they nearly always step to a neighbour (4 of 1,909 changes went straight between Bull and Bear), and bear days dipped about twice as deep as bull days, but only 2 of 24 regime and market cells told the forward return apart from an ordinary day.

Read more→
#139

Coin Flip Trading: What Randomness Tells Us About Market Bias

Oct 11, 2025 · 5 min read

Coin flip backtests show hidden market tendencies in ES, NG, and AD.

Read more→

Overfit - the newsletter

Skip the hype. Trust the data.

One practical, evidence-driven takeaway per issue - strategy testing, portfolio construction, market structure, trading psychology, tactical asset allocation.

Running a quick security check before this can be sent.

Delivered +2 times a month - when the work is ready, not on a calendar.I'll never sell your address.Unsubscribe in one click, any time.

StatOasis is calm, evidence-based algorithmic-trading education, founded by Ali Casey. Ali builds systematic trading strategies and teaches the workflow behind them: research, build, test, combine, deploy. He writes the Overfit newsletter, published since 2024, and runs the Algo Trading Masterclass.

Socials

  • X ↗
  • YouTube ↗
  • Instagram ↗
  • LinkedIn ↗
  • GitHub ↗
  • Muck Rack ↗
  • LinkedIn SO ↗
  • GitHub SO ↗

Products

  • Overfit - the newsletter
  • Algo Trading Masterclass
  • StatOasis Community
  • 36 Ways to Buy the Dip
  • AlgoChef ↗

Reading & tools

  • Research
  • Methodology
  • Survive the Decade
  • Wall of Love

StatOasis

  • About Ali Casey
  • Contact
© 2026 StatOasis. Calm, evidence-based.
PrivacyTermsHypothetical resultsCalifornia