New: the Top 10 Non-Repainting MT4 Indicator Pack is free to download

92 free indicators for MetaTrader 4 & 5

Rainbow EMA Indicator MT4

Free Rainbow EMA indicator for MT4. Plots a ribbon of up to 12 EMAs in a color gradient and flags full bull/bear stacks. Settings, strategy and install guide. Free download, link emailed in seconds.

MT4Non-repaintingTrend
Data Windowrainbow-ema-indicator-mt4
PlatformMT4 Build 600+
File.mq4 / .ex4 in .zip
Version1.0
Size4.7 KB
RepaintsNo
TypeTrend
UpdatedNov 22, 2026
DownloadsNew listing
Download free (4.7 KB)
  • Enter your email, the download link arrives in seconds
  • Free bonus reports on the next page

Indicators are analysis tools, not trade signals. Forex trading on margin carries a high risk of loss. Test on a demo account first.

EURUSD · H4 · previewRainbow EMA Indicator MT4 v1.0
Rainbow EMA Indicator MT4 on EURUSD H4Non-repainting
How it works →
Overview

The Rainbow EMA indicator for MT4 draws a ribbon of up to 12 exponential moving averages, 5 through 60 by default, colored in a gradient from the fastest line to the slowest. When the ribbon fans out in perfect order the trend is strong, and an optional highlight marks every closed candle where all the EMAs are stacked bullish or bearish.

It is a free, lightweight version of the classic “rainbow” chart that many forex traders use to read trend strength and pullbacks at a glance, with clear inputs and no hidden logic.

What Is the Rainbow EMA Indicator?

A rainbow EMA, also called an EMA ribbon or moving average ribbon, plots many moving averages of increasing length on the same chart. One average can tell you direction. A dozen of them tell you how orderly that direction is. In a healthy uptrend the short EMAs sit above the longer ones and the ribbon widens. In a pullback the fast lines dip into the ribbon. In a range the colors tangle together and flatten.

The name comes from the color scheme: in the default mode the fastest line is red and each slower line shifts through orange, yellow, green and blue to violet, so you can tell which EMA is which without hovering over it. Traders searching for a “rainbow forex” indicator are usually looking for exactly this kind of ribbon.

How the Indicator Is Calculated

Every line is a standard exponential moving average calculated with MetaTrader’s built-in EMA on the price you choose (close by default). The periods are evenly spaced:

  • EMA 1 uses StartPeriod.
  • Each next EMA adds PeriodStep, so with StartPeriod 5, PeriodStep 5 and EmaCount 12 the ribbon is 5, 10, 15, 20, 25, 30, 35, 40, 45, 50, 55 and 60.
  • EmaCount can be anything from 2 to 12. Unused lines are hidden.

Colors are assigned by position in the ribbon. In rainbow mode the hue moves from 0 degrees (red) on the fastest EMA to 270 degrees (violet) on the slowest, evenly spaced. In two-color mode each line is a straight blend between StartColor and EndColor.

The stack check is simple and strict. On each closed candle the code compares every EMA with the next slower one. If every faster EMA is above its slower neighbor, the ribbon is fully stacked bullish and the fastest EMA is overdrawn with a thick line in BullStackColor. If every faster EMA is below its slower neighbor, it is a bearish stack and the highlight uses BearStackColor. If even one pair is out of order, there is no highlight.

Key Features

  • Ribbon of 2 to 12 EMAs with adjustable start period, step and applied price.
  • Automatic rainbow gradient, or a custom two-color blend that matches your chart theme.
  • Optional full-stack highlight that shows where the trend is perfectly aligned.
  • Highlight evaluated on closed candles only, so it does not flicker on the live candle.
  • Every EMA value is shown in the Data Window with its period as the label.
  • No chart objects, no alerts to configure, very light on the terminal.

How to Trade With the Rainbow EMA Indicator

The ribbon works best as a trend map on H1, H4 and daily charts, which is why it suits swing trading. Some ways traders use it:

Trend direction and strength

Only look for longs when the ribbon is stacked bullish or mostly bullish, and only look for shorts when it is stacked bearish. A wide, evenly spaced ribbon shows a steady trend. A ribbon that is narrowing after a long run often comes before a pause or a reversal.

Pullback entries

  • In a bullish stack, wait for price to pull back into the ribbon, ideally into the middle lines (for example the 20 to 35 EMAs).
  • Enter when a candle closes back above the faster lines, or when the full-stack highlight returns after a short break.
  • Place the stop below the pullback low or below the slowest EMA.
  • Reverse the rules for shorts in a bearish stack.

Using two timeframes

A common routine is to load the ribbon on a higher timeframe, such as H4 or D1, and only trade in the direction of that stack. Then drop to H1 and use the same ribbon to time pullback entries. When both timeframes show a full stack in the same direction, the trend is aligned. When they disagree, it is usually better to wait for the lower timeframe to rejoin the higher one.

When to stand aside

When the colors cross over each other and the ribbon goes flat, there is no trend to follow. Pullback entries in that state tend to fail. Range tools, or a volatility filter like the Choppiness Index indicator, are better choices there.

Use the position size calculator to keep risk per trade consistent when stops are placed at the ribbon edge, since that distance changes from trade to trade.

Best Settings

Goal StartPeriod / PeriodStep / EmaCount Ribbon
Default 5 / 5 / 12 5 to 60
Faster, intraday 3 / 3 / 10 3 to 30
Slower, swing 10 / 10 / 10 10 to 100

A ribbon with fewer lines is easier to read on small screens, while 12 lines give a smoother picture of trend strength. The full-stack highlight is stricter with more lines, because more pairs have to be in order. If you rarely see it on your timeframe, lower EmaCount or the step.

Does It Repaint?

No. Every EMA on the live candle moves with price, which is normal for moving averages, and it is fixed once the candle closes. The full-stack highlight is only calculated from bar 1 backward, so the live candle never gets a highlight that could vanish before it closes. Because a line segment needs two points, a highlighted candle is drawn as a short segment that starts at the previous candle. That is a drawing detail, not a change in the signal. See what repainting is for why closed-candle logic matters when you review old charts.

How to Install

Copy “rainbow-ema-indicator-mt4.mq4” to File > Open Data Folder > MQL4 > Indicators, restart MT4 or refresh the Navigator, then drag it onto a chart. Step-by-step help, including what to do if it does not appear, is in how to install indicators in MT4.

Related Indicators

More options are listed under trend indicators. A ribbon describes the trend that already happened and does not predict the next move. Trading on margin carries a high level of risk, so test any approach on a demo account first.

Rainbow EMA Indicator MT4 on an EURUSD H4 MT4 chart

Rainbow EMA Indicator MT4 on a MetaTrader chart. Click to enlarge.

Repaint verdict: does not repaint. We read the source: every value is calculated on closed bars and never rewritten, so what you see in history is what you would have seen live.

Free pack

Get the Top 10 Non-Repainting Indicator Pack

Ten MT4 indicators that draw on closed bars only, in one zip with install notes for each.

Settings

Inputs, defaults and what they change

  • StartPeriod (default 5) — Period of the fastest EMA in the ribbon.
  • PeriodStep (default 5) — Amount added to the period for each next EMA. With the defaults the ribbon runs 5, 10, 15 … 60.
  • EmaCount (default 12) — How many EMAs to draw, from 2 to 12. Values outside that range are clamped.
  • EmaPrice (default PRICE_CLOSE) — Applied price for every EMA.
  • GradientMode (default GRADIENT_RAINBOW) — GRADIENT_RAINBOW spreads hues from red (fastest) to violet (slowest); GRADIENT_TWO_COLOR blends StartColor into EndColor.
  • StartColor (default clrRed) — Fastest EMA color in two-color mode.
  • EndColor (default clrBlue) — Slowest EMA color in two-color mode.
  • LineWidth (default 1) — Width of the ribbon lines.
  • HighlightStack (default true) — Draw a thick highlight over the fastest EMA on closed candles where the whole ribbon is stacked in order.
  • BullStackColor (default clrLime) — Highlight color when every faster EMA is above the next slower one.
  • BearStackColor (default clrMagenta) — Highlight color when every faster EMA is below the next slower one.
  • HighlightWidth (default 4) — Width of the highlight line.
Install

How to install it in MetaTrader 4

  1. Step 1Download and unzip

    Enter your email, open the download link we send you and extract the .mq4 / .ex4 file from the zip.

  2. Step 2Open the data folder

    In MetaTrader, go to File → Open Data Folder.

  3. Step 3Copy into Indicators

    Place the file in MQL4 → Indicators, then restart MetaTrader or refresh the Navigator panel.

  4. Step 4Attach it to a chart

    Find it under Navigator → Indicators and drag it onto any chart.

First time installing an indicator? Watch the 75-second video or follow the screenshots in our MT4 install guide: every click in MetaTrader, plus fixes for an indicator that won't show up.

Free forex calculators
FAQ

Rainbow EMA Indicator MT4 questions

A rainbow EMA is a group of exponential moving averages with evenly spaced periods, drawn in a color gradient. When the lines are stacked in order and spreading apart, the trend is strong. When they tangle together, the market is ranging.

By default it draws 12 EMAs from 5 to 60 in steps of 5. You can change the start period, the step and the number of lines (2 to 12) in the inputs.

It appears on closed candles where the whole ribbon is in perfect order. Green (lime) means every faster EMA is above the next slower one, a bullish stack. Magenta means every faster EMA is below the next slower one, a bearish stack.

No. The lines on the current candle move with price until it closes, like any moving average, and the stack highlight is only calculated on closed candles. Nothing changes on past candles.

It can be used on low timeframes with shorter settings such as 3/3/10, but ribbons are slower by design and tend to be more useful for reading the trend on H1 and above. Many scalpers use it on a higher timeframe for direction and trade a lower one.

Yes. Set GradientMode to GRADIENT_TWO_COLOR and choose StartColor and EndColor. Every line in between is blended automatically. The highlight colors are set separately.

Rainbow EMA Indicator MT4
Size
4.7 KB
Version
1.0
Repaints
No
Download free
Free packTop 10 Non-Repainting Indicators

Ten closed-bar MT4 indicators in one zip.

Get the pack

Rainbow EMA Indicator MT4Free · 4.7 KB

Download

Where should we email your download link?

Use an email you can check right now: the download link goes straight to this inbox.