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.
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.
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.
| Stack | Gap in ATR, pair 1 (fastest) | Pair 2 | Pair 3 | Pair 4 (slowest) | Daily-change correlation, top pair |
|---|---|---|---|---|---|
| Even, 10-20-30-40-50 | 0.66 | 0.54 | 0.47 | 0.42 | 0.90 |
| Ratio, 10-15-22-33-50 | 0.38 | 0.44 | 0.57 | 0.71 | 0.81 |
| Fibonacci, 5-8-13-21-34 | 0.32 | 0.41 | 0.51 | 0.66 | 0.79 |
Mean of the 11 futures, simple moving averages.
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.
| Stack | Share of alignment breaks, pair 1 | Pair 2 | Pair 3 | Pair 4 | Pair 1 crossings a year |
|---|---|---|---|---|---|
| Even, 10-50 | 74.5% | 12.4% | 7.4% | 5.7% | 13.22 |
| Ratio, 10-50 | 78.7% | 11.5% | 6.6% | 3.2% | 18.68 |
| Fibonacci, 5-34 | 83.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.
| Stack | Alignments a year | False flips a year | Share of completed alignments that die inside 5 bars | Median alignment (bars) | Time aligned |
|---|---|---|---|---|---|
| Even, 10-50 | 7.63 | 2.37 | 31.1% | 10.6 | 44.6% |
| Ratio, 10-50 | 9.05 | 3.03 | 33.5% | 9.0 | 43.0% |
| Fibonacci, 5-34 | 14.80 | 6.56 | 44.3% | 5.0 | 38.9% |
| Even, 10-50, EMA | 6.96 | 1.00 | 14.4% | 19.0 | 72.4% |
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.
| Stack | Signal, both sides | Trades | Median Ret/DD | Median profit factor | Markets profitable |
|---|---|---|---|---|---|
| Even, 10-50 | Align | 1,809 | 0.67 | 1.15 | 7 of 11 |
| Ratio, 10-50 | Align | 2,147 | 0.46 | 1.09 | 8 of 11 |
| Even, 10-50 | Pullback | 1,556 | 0.82 | 1.26 | 8 of 11 |
| Ratio, 10-50 | Pullback | 1,867 | 1.06 | 1.27 | 9 of 11 |
| Fibonacci, 5-34 | Align | 3,516 | -0.20 | 0.95 | 4 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.
| Signal | Side | Ratio stack better Ret/DD (of 165) | Median Ret/DD, even | Median Ret/DD, ratio |
|---|---|---|---|---|
| Align | Long | 63 | 0.84 | 0.83 |
| Align | Short | 88 | -0.08 | -0.04 |
| Align | Both | 70 | 0.46 | 0.34 |
| Pullback | Long | 84 | 0.62 | 0.55 |
| Pullback | Short | 88 | -0.06 | -0.05 |
| Pullback | Both | 87 | 0.67 | 0.48 |
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) | Cells | Lowest median Ret/DD | Median of the cells | Markets profitable |
|---|---|---|---|---|
| Ratio stacks, start 8 to 12, ratio 1.3 to 1.8 | 18 | 0.20 | 0.84 | at least 7 of 11 (median 9) |
| Ratio stacks, starts outside 8 to 12 | 0.43 | |||
| Evenly spaced stacks, start 8 to 12 | 21 | 0.14 | 0.82 |
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.
| Stack | Signal | Long median Ret/DD | Long markets profitable | Short median Ret/DD | Short markets profitable |
|---|---|---|---|---|---|
| Even, 10-50 | Align | 1.71 | 8 of 11 | -0.02 | 5 of 11 |
| Even, 10-50 | Pullback | 0.73 | 8 of 11 | -0.21 | 4 of 11 |
| Ratio, 10-50 | Align | 0.68 | 9 of 11 | -0.04 | 5 of 11 |
| Ratio, 10-50 | Pullback | 1.33 | 9 of 11 | -0.27 | 5 of 11 |
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
- 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.
- 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.
- 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.
- 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.
- 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.








