Averages Rainbow Indicator: Eight EMAs In A Single Fan

Written by Dominic Walsh · Published · Last updated

The averages rainbow indicator turns one moving average into eight. Periods start at `InpBasePeriod` `8` and step up by `InpStep` `6`. Drawn together they make a fan. It opens in a trend and closes in a range.

This build ships as a compiled .ex4 for MT4 and .ex5 for MT5; the screenshots below come from EURUSD H1.

Platforms MT4 (.ex4) + MT5 (.ex5)
Chart window Main price chart
Plots 8: EMA 1, EMA 2, EMA 3, EMA 4, EMA 5, EMA 6, EMA 7, EMA 8
Alerts popup, push notification, email, sound
Inputs 13

What the Averages Rainbow Indicator draws on the chart

`EMA 1` runs red at the fastest period and `EMA 8` runs violet at the slowest.

The six lines between them shade through orange, gold, green and blue.

Wide spacing means a trend, and tight spacing means compression.

A corner panel reports the current bias and whether the fan is squeezed.

  • EMA 1: line, red, width 2
  • EMA 2: line, orange red, width 2
  • EMA 3: line, orange, width 2
  • EMA 4: line, gold, width 2
  • EMA 5: line, lime green, width 2
  • EMA 6: line, deep sky blue, width 2
  • EMA 7: line, royal blue, width 2
  • EMA 8: line, blue violet, width 3
Averages rainbow indicator eight-EMA fan and bias panel on the EURUSD H1 chart.
Averages rainbow indicator eight-EMA fan and bias panel on the EURUSD H1 chart.

How the Averages Rainbow Indicator calculates its values

Eight periods, evenly spaced

The fastest line uses `InpBasePeriod` `8`. Each line after it adds `InpStep` `6`. So the slowest reaches fifty. Even spacing makes the fan open smoothly.

Each line seeds from a simple average

A recursive average started from zero would spike at the left edge. So each line begins with a simple mean at its own warmup point. The recursion runs from there.

Compression has a definition

`InpSqueezeMult` `0.35` compares the gap between fastest and slowest against recent range. Below that fraction the panel calls it a squeeze. That gives the state a number rather than a feel.

How to read the signals

Order matters more than any single line.

A fan in strict order means one direction holds across every period.

Tangled lines mean no window agrees.

The alert fires when `EMA 1` crosses `EMA 8`.

Alert channels in this build: popup, push notification, email and sound, one message per closed bar.

`EnableAlerts` covers the whole set and starts true beside `EnablePopup`. `EnablePushNotify` reaches a handset, `EnableEmail` sends mail and `EnableSound` plays `SoundFile`. Those three arrive off. The flip reports once per closed bar.

Every Averages Rainbow Indicator input

Core settings

Setting What it does Default
InpBasePeriod Fastest EMA period. Period of the fastest line, default `8`. 8
InpStep Period step between ribbons. Period added for each slower line, default `6`. 6
InpAppliedPrice Applied price (0=close,1=open,4=median). Price every line reads, default `PRICE_CLOSE`. PRICE_CLOSE
InpSqueezeMult Compression: ribbon width < mult * ATR. Fan width against range that counts as compression, default `0.35`. 0.35

Display settings

Setting What it does Default
ShowPanel Show ribbon panel. Show the bias and compression readout, default `true`. on
PanelCorner Corner (0=UL,1=UR,2=LL,3=LR). Corner the readout anchors to, default `0`. 0
PanelBg Readout background, default `clrBlack`. black

Alert settings

Setting What it does Default
EnableAlerts Overall control of the routes, default `true`. on
EnablePopup Terminal window on a fan flip, default `true`. on
EnablePushNotify Handset message on a fan flip, default `false`. off
EnableEmail (see inputs panel) off
EnableSound (see inputs panel) off
SoundFile (see inputs panel) alert.wav
Averages rainbow indicator inputs panel with InpBasePeriod, InpStep and InpSqueezeMult.
Averages rainbow indicator inputs panel with InpBasePeriod, InpStep and InpSqueezeMult.

Settings that fit your chart

A fifty-bar slowest line needs history. EURUSD H1 is the reference chart. The fan opens and closes a few times a week there. On M5 the lines tangle. H4 gives a slow, clear picture.

When the Averages Rainbow Indicator fails

Eight lines is a lot of chart, especially with other tools loaded.

The fan confirms a trend that is already running, since every line lags.

Compression tells you the market is quiet, never which way it breaks.

Copy the compiled Averages Rainbow Indicator file into your MQL4/Indicators folder, and the MT5 build into MQL5/Indicators, then restart the terminal and drag it onto a chart. The step-by-step guide with screenshots is at how to install MT4 and MT5 indicators.

Background reading on the method behind the Averages Rainbow Indicator: Hot equity periods on Wikipedia, idemarker (DEMARKER) at the MQL5 Documentation.

Download the Averages Rainbow Indicator for MT4 and MT5

The zip holds the compiled Averages Rainbow Indicator build for MT4 and MT5, plus a short README. Compiled files only, no source. Enter your email below and the download link arrives in your inbox.

Download this indicator free

Enter your email and the file is yours. You also get the full MT4 and MT5 library.

  • 1,380+ indicators
  • MT4 and MT5 files
  • No spam, unsubscribe any time

FAQ

What periods does InpStep 6 produce?

Starting from eight, the fan runs 8, 14, 20, 26, 32, 38, 44 and 50. Raising the step spreads the periods further apart, which widens the fan and makes compression rarer. Lowering it packs the lines together.

How does InpSqueezeMult 0.35 define compression?

It holds the gap between the fastest and slowest lines against the recent range reading. When that gap falls under thirty-five percent of range, the panel calls it a squeeze.

Why seed each EMA with a simple average?

A recursive average started from zero makes a huge spike at the left edge of the chart. Seeding at the warmup point with a plain mean lets every line start at a sensible value.

What triggers the EMA 1 alert?

The fastest line crossing the slowest, which means the whole fan has flipped rather than one pair. That is a much rarer event than any single crossing inside the fan.

Are results guaranteed?

No. Trading involves risk. Results are not guaranteed; past performance is not indicative of future results. Use the Averages Rainbow Indicator as one input. Always backtest before trading live.

External references

Dominic Walsh - Forex trader and MT4/MT5 developer

About the author

Written by Dominic Walsh, a Forex trader and MT4/MT5 indicator, Expert Advisor and script developer. Every tool on forexmt4systems.com is tested on live charts before release and ships with ready-to-use compiled MT4 (.ex4) and MT5 (.ex5) files. Learn more about the trader and developer behind this site.

How we build, test and correct every tool: Editorial & Testing Policy. Trading carries risk; see the disclaimer.

Leave a Comment