Rainbow Oscillator

Rainbow Oscillator – Strategy, Rules, Returns

Analyzing the financial markets can be a difficult task but there are numerous indicators to help with that — one such indicator is the Rainbow Oscillator. What do you know about this indicator and how it works?

The Rainbow Oscillator is a technical indicator that uses the highest high and the lowest low of one or more simple moving averages to determine market trends and possibly identify potential overbought/oversold or reversal levels. It is based on multiple moving averages and consists of high and low oscillator curves that are color-coded. The width of the curves is used to determine whether the market is trending or not.

In this post, we will take a look at everything you need to know about this trading indicator: what it is, how it works, and how you can improve your trading strategies with it. Let’s dive in!

Table of contents:

Key takeaways

  • The Rainbow Oscillator is a technical indicator that uses the highest high and the lowest low of one or more simple moving averages to determine market trends
  • It can also possibly identify potential overbought/oversold or reversal levels
  • Based on multiple moving averages
  • Using colors to show levels
  • Wide curves indicate trending markets
  • We provide you with a complete trading strategy (backtested)

What is a Rainbow Oscillator?

Rainbow Oscillator

The Rainbow Oscillator is a technical indicator that uses the highest high and the lowest low of one or more simple moving averages to determine market trends and possibly identify potential overbought/oversold or reversal levels. It is based on multiple moving averages and consists of high and low oscillator curves that are color-coded. The width of the curves is used to determine whether the market is trending.

Developed by Mel Widner, the indicator derives a market consensus from the repetitive smoothing of the moving averages. Values between -50 and +50 signal that the trend is stable, with positive values indicating an uptrend and negative values indicating a downtrend. If the curves’ width becomes wider, the trend may likely continue, but beyond a certain level, say +70/80 and -70/80, the trend may be unstable, signaling a potential reversal.

The chart below shows the Rainbow Oscillator (in Amibroker):

Rainbow Oscillator trading rules
Rainbow Oscillator trading rules

The middle pane shows the colors, while the lower pane shows the width, and the colors show above or below zero.

How does the Rainbow Oscillator work?

The Rainbow Oscillator works as a trend-following indicator that can also show overbought/oversold levels and market reversals. Derived from a consensus of the rainbow charts (2-period simple moving average) trends, it finds the highest high and lowest low of those moving averages and uses them to create an oscillator and bandwidth lines that track price movements.

With repeated smoothing applied to the primary moving average, nine more moving averages are created — each new moving average is based on the previous moving average.

The width of the curves shows whether the market is trending or not. When it is between -50 and +50, the trend is stable, with positive values indicating an uptrend and negative values indicating a downtrend. If the bandwidth becomes wider, the trend is likely to continue. However, after a certain level, say +80 and -80, the trend may be unstable, signaling a potential reversal.

Why is the Rainbow Oscillator used in trading?

The rainbow oscillator is used in trading because it shows market trends and can also show overbought/oversold levels and market reversals. It is a unique indicator that uses the highs and lows of moving averages to create oscillator curves that track the price movement.

Traders use the width of the curves to know whether the market is trending or not. The indicator can also be used to identify a potential price reversal.

Rainbow Oscillator trading strategy – trading rules, returns, and performance

We have explained the Rainbow Oscillator, and now it’s time to make a strategy complete with trading rules and backtest it.

We make the following trading rules:

THIS SECTION IS FOR MEMBERS ONLY. _________________ BECOME A MEBER TO GET ACCESS TO TRADING RULES IN ALL ARTICLES CLICK HERE TO SEE ALL 400 ARTICLES WITH BACKTESTS & TRADING RULES

If we apply the trading rules we get the following equity curve for the gold price (GLD from its inception until today):

Rainbow Oscillator trading strategy
Rainbow Oscillator trading strategy

Let’s look at the statistics and trading performance metrics:

Table of Key Statistics (Rainbow Oscillator)

Let’s explore the essential statistics and data derived from the trading strategy:

StatisticsValue
Total Trades72
Average Gain per Trade0.98%
CAGR3.5%
Win Rate73%
Average Winning Trade2%
Average Losing Trade-1.9%
Max Drawdown-18%
Time Invested in the Market17%
Risk-adjusted Return20.6%

With an average gain per trade of 0.98% and a win rate of 73%, the strategy demonstrates consistent profitability and efficacy in capturing market movements.

The calculated CAGR of 3.5% signifies a respectable annual growth rate, while the risk-adjusted return of 20.6% underscores its ability to deliver favorable returns relative to the time invested in the market. Moreover, the max drawdown is relatively mild.

If a shorter lookback period is chosen, for example, 2 days, the strategy works pretty well for the main stock indices.

Rainbow Oscillator strategy – complete code

The complete code for the strategy is like this (Amibroker code):

THIS SECTION IS FOR MEMBERS ONLY. _________________ BECOME A MEBER TO GET ACCESS TO TRADING RULES IN ALL ARTICLES CLICK HERE TO SEE ALL 400 ARTICLES WITH BACKTESTS & TRADING RULES

What are the components of the Rainbow Oscillator?

The components of the rainbow oscillator are the moving averages from which it is created. Specifically, the components are a 2-period moving average, the highest highs and the lowest lows of the moving averages that are used to calculate the indicator, and the close prices.

The 2-period average is recursively smoothened to create nine more 2-period averages with each new one based on the previous one, thereby giving rise to 10 moving averages that form a rainbow when plotted on a chart.

How is the Rainbow Oscillator calculated?

The Rainbow Oscillator is calculated as follows:

Rainbow Oscillator = 100 * ((value – avAv) / (highest – lowest));

Where:

Highest = highest value of the moving average over 10 periods

Lowest = lowest value of the moving average over 10 periods

Value = closing price at the time of calculation

avAV = series of averages with each new average based on the previous one, given as:

r1: = Mov (C,2,S);

r2: = Mov (r1,2,S);

r3: = Mov (r2,2,S);

r4: = Mov (r3,2,S);

r5: = Mov (r4,2,S);

r6: = Mov (r5,2,S);

r7: = Mov (r6,2,S);

r8: = Mov (r7,2,S);

r9: = Mov (r8,2,S);

r10: = Mov (r9,2,S)

where:

Mov(C, 2, S) = 2-period simple moving average of closing prices

Mov(r1, 2, S) = 2-period simple moving average of r1

And so on until the moving average of r9 is calculated.

What does the Rainbow Oscillator indicate in the market?

In the market, the rainbow oscillator indicates the trends: the direction, the stability, and the likelihood of a reversal. The indicator has upper and lower bands that expand and form curves, whose widths indicate whether the market is trending.

When the curves of the indicator are between -50 and +50, the trend is stable, with positive values indicating an uptrend and negative values indicating a downtrend. If the width becomes wider, the trend may continue. However, after a certain level, say +80 and -80, the trend may be unstable, signaling a potential reversal.

How does the Rainbow Oscillator differ from other indicators?

The rainbow oscillator differs from other indicators in that it is calculated based on the recursive moving average of moving averages up to the order of 10.

Unlike other indicators, the rainbow oscillator is based on a 2-period average that is repeatedly smoothened to create nine more 2-period averages with each new one based on the previous one, giving rise to 10 moving averages that form a rainbow when plotted on a chart. The curves of the rainbow are used to identify market trends and trend stability.

When was the Rainbow Oscillator first introduced?

The Rainbow Oscillator was first introduced in July 1997. It was described in the July 1997 issue of Stocks and Commodities magazine by Mel Widner, where he presented it as a trend-changing indicator.

Who developed the Rainbow Oscillator?

The Rainbow Oscillator was developed by Mel Widner, Ph.D. He first published it in the July 1997 issue of Stocks and Commodities magazine.

What are the benefits of using the Rainbow Oscillator?

The benefits of using the rainbow oscillator are many. These are some of them:

  • The indicator shows whether the market is trending or consolidating — when the indicator curves expand beyond the +50 and -50 levels, the market is likely trending, and when the curves are flat, the market is probably moving sideways.
  • It could also indicate the direction of the trend — If the upper curve is expanding more, it indicates an uptrend, but if it is the lower curve expanding, it indicates a downtrend.
  • It can be used to gauge the strength and stability of the market — the farther away from the middle the curves are, the stronger the trend, but this is up to a point (+80 and -0 levels). Beyond that, the trend is unstable and likely to reverse. When the curves are within +50 and -50 levels, the trend is stable.

What are the limitations of the Rainbow Oscillator?

The limitations of the rainbow oscillator include:

  • It is a lagging indicator: As with most indicators, the rainbow indicator lags the price because it is calculated based on the moving average of past price data and it’s even smoothened several times.
  • The indicator’s predictive power is small: It cannot tell you what would happen next in the market. It only tells you how the price has moved in the past.
  • It can give false signals: The rainbow oscillator is prone to many false signals, especially during a rapidly changing market condition.

Can the Rainbow Oscillator be used in different timeframes?

Yes, the rainbow oscillator can be used in different timeframes, depending on the trader’s trading style and what they want in their market analysis. A day trader may want to use the indicator on the hourly or 15-minute timeframe or even both. A swing trader may do their analysis on the daily or 4-hourly timeframe, while a position trader may try out some higher timeframes. Whatever the timeframe, it is necessary to know how to interpret the signals from the indicator.

How can traders interpret signals from the Rainbow Oscillator?

Traders can interpret signals from the rainbow oscillator by watching how the upper and lower curves of the indicator move. The widths of the curves indicate whether the market is trending or not. When they expand beyond the +50 and -50 levels, the market is likely trending — if the upper curve is expanding more, the trend is up, but if it is the lower curve expanding, it indicates a downtrend. When the curves are flat, the market is likely moving sideways.

The farther away from the middle the curves are, the stronger the trend, but this is up to a point (+80 and -0 levels). Beyond that, the trend is unstable and likely to reverse. When the curves are within +50 and -50 levels, the trend is stable.

Are there any strategies associated with the Rainbow Oscillator?

Strategies associated with the rainbow oscillator are mostly algorithmic. Most traders who use the indicator use it to create algorithmic trading strategies with the logic they have found to offer them profitability.

However, traders can still create manual or discretional trading strategies with the indicator. That may require combining it with other indicators to improve the effectiveness.

What are the common misconceptions about the Rainbow Oscillator?

The common misconceptions about the rainbow oscillator are as follows:

  • The rainbow oscillator can be used to predict future market movement: As with other indicators calculated from past price data, the rainbow oscillator lags and, thus, cannot tell you what would happen next. It can only tell what has happened, which traders can project into the future to make trading decisions. However, all such projections are based on the probability of history repeating itself.
  • The rainbow oscillator can be a trading strategy on its own: It is only an indicator and cannot be a strategy on its own. Any trader who wishes to use it must find a way to define entry and exit criteria and risk management.

How does the Rainbow Oscillator help identify trends?

The rainbow oscillator helps identify trends through the movement of its upper and lower curves. The widths of the curves can tell whether the market is trending or not. The curves expanding beyond the +50 and -50 levels show that the market is likely trending — if the upper curve is expanding more, the trend is up, but if it is the lower curve expanding, the trend is down.

The farther away from the middle the curves are, the stronger the trend, but this is up to a point (+80 and -0 levels). Beyond that, the trend is unstable and likely to reverse. When the curves are flat within +50 and -50 levels, the trend is stable, and the market is likely moving sideways.

Can the Rainbow Oscillator be used for both bullish and bearish markets?

Yes, the rainbow oscillator can be used for both bullish and bearish markets. While both upper and lower curves expand and retract, in a bullish market, the indicator posts more positive values than negative values, so the upper curve expands more than the lower curve.

Likewise, in a bearish market, the indicator posts more negative values, so the lower curve expands more than the upper curve.

What are the key factors influencing Rainbow Oscillator readings?

The key factors influencing rainbow oscillator readings include:

  • The market condition: When the market condition is very choppy, rainbow oscillator readings could be prone to whipsaws and highly unreliable.
  • The speed of price advance or decline: If the market is moving very fast, the indicator curves might expand very fast and the readings might be in the unstable regions while the market is still very healthy and could go a second and third leg.
  • The timeframe: The timeframe a trader chooses would determine how often the indicator readings show a signal. An M15 timeframe would show signals more often than the H4 timeframe would.

Is the Rainbow Oscillator suitable for beginners in trading?

No, the rainbow oscillator is not suitable for beginners in trading. The indicator is very complex and not easy to use. Many traders who use it are experienced algo traders who know what to look for and how to easily backtest their ideas.

Beginners need an indicator that is easy to learn and use so they can formulate a strategy with it and be able to backtest it with ease.

How can traders optimize the Rainbow Oscillator for better results?

To optimize the rainbow oscillator for better results, traders may have to combine it with other technical analysis tools, such as price action analysis or other technical or sentiment indicators to get a better idea of where the price is in a market cycle.

It may also be necessary to use fundamental analysis to get an idea of what the market is up to before using the rainbow oscillator and other tools to time when to enter and exit the market.

What role does volatility play in Rainbow Oscillator analysis?

Volatility plays a huge role in the rainbow oscillator analysis. It can affect the reading of the indicator. When there is low volatility and the market is in a tight consolidation, the indicator curves are flat. On the other hand, when there is high volatility with choppiness (huge swings spiking around), the indicator gives erratic signals.

The rainbow oscillator works best when the market is stable and trending nicely in one direction. In such a situation, you can use it to identify the trend and possibly trade in the trend direction.

Are there any risks associated with relying solely on the Rainbow Oscillator?

Yes, there are some risks associated with relying solely on the rainbow oscillator. Here are some of them:

  • The rainbow oscillator can give frequent false signals, especially when the market is very volatile and choppy. Since the indicator doesn’t know when the market conditions will change, relying solely on it would lead to poor trading and huge losses.
  • The indicator can’t identify when the market is choppy and unfavorable for trading.
  • It lags the price because it uses past price data in its calculations, so what it shows is about the past, not the future.

How does the Rainbow Oscillator perform in different market conditions?

The rainbow oscillator performs differently in different market conditions. It performs well when the market is stable and trending nicely in one direction, where you can use it to identify and possibly trade the trend.

However, when the market condition is very choppy, rainbow oscillator readings could be prone to whipsaws and highly unreliable. If the market is moving very fast, the indicator curves might expand very fast giving an unstable signal while the market is still very healthy and could go a second and third leg.

What are some real-world examples of Rainbow Oscillator application?

Here are a few real-world examples of the rainbow oscillator application:

Example 1: Identifying an uptrend:

In the chart below, you can see the upper and lower curves of the indicator expand to show that the price is trending. Notice how the upper curve is expanding more than the lower curve. The upper curve is hitting the +80 level, while the lower curve couldn’t even get to the -50 level.

Rainbow Oscillator example
Rainbow Oscillator example

Example 2: Identifying a downtrend:

The chart below shows a downtrend. See how the upper and lower curves of the indicator expand to show that the price is trending. Notice that the lower curve is expanding more than the upper curve.

The lower curve is hitting the -80 level, while the upper curve couldn’t even get to the +50 level. When the trend started changing at the end, the upper curve started expanding more, rising towards the +80 level.

Rainbow Oscillator real world application
Rainbow Oscillator real world application

How can traders incorporate the Rainbow Oscillator into their trading strategy?

To incorporate the rainbow oscillator into their trading strategy, traders can combine the indicator with other trading indicators or price action analysis to formulate a unique trading strategy with clear entry and exit criteria, position sizing, and risk management plans.

Using the rainbow oscillator alone may not be the best idea unless you can easily turn it into a trading algo that allows you to backtest multiple ideas in no time to see what works. Manual/discretionary traders need to use it with other analysis tools that provide a better understanding of the market structure and price movements.

Similar Posts