Author: Code written by - Akuma99
RainbowMMA

The Rainbow MMA 1 is a specialized technical analysis tool designed to provide traders with a comprehensive visual overview of market trends. Rather than relying on a single data point, this indicator plots multiple Moving Averages (MAs) simultaneously onto your trading chart, creating a multi-layered "rainbow" of information.

How the Logic Works

The core logic of this script is based on identifying trend momentum across different time horizons. It calculates eight distinct Exponential Moving Averages (EMAs) using the closing prices of the assets. Each line represents a different level of sensitivity to price movement:

  • Short-Term Trends: The faster moving averages (covering shorter periods like 15, 30, and 60 units) react quickly to recent price fluctuations. These are ideal for identifying immediate momentum shifts.
  • Medium-Term Trends: The intermediate lines (covering periods such as 120 and 240 units) smooth out the "noise" of daily trading to show more stable trends.
  • Long-Term Trends: The slowest moving averages (spanning up to 960 units) represent the broader market structure. These lines move much more slowly and are used to identify major support, resistance, and long-term cycles.

Visual Interpretation

By displaying all eight lines at once, the indicator allows you to see the "order" of the market at a glance:

  1. Trend Confirmation: When multiple lines are stacked in the same direction and moving parallel to one another, it signals a strong, established trend.
  2. Potential Reversals: When the faster lines begin to cross or diverge significantly from the slower, larger lines, it can indicate that the current momentum is weakening.
  3. Support and Resistance: The wider gaps between the long-term "rainbow" lines help traders identify key price zones where the market may encounter significant friction.

In summary, this tool converts complex price history into a visual map of market velocity, helping you distinguish between temporary price spikes and significant, sustained trend movements.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
9 Views
0 Downloads
0 Favorites
RainbowMMA
/*

*********************************************************************
          
                        Rainbow MMA 1
                   Copyright ?2006  Akuma99
                  http://www.beginnertrader.com
                  
*********************************************************************

*/


#property copyright "Code written by - Akuma99"

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 Red
#property indicator_color2 Orange
#property indicator_color3 Gold
#property indicator_color4 Lime
#property indicator_color5 Aqua
#property indicator_color6 DodgerBlue
#property indicator_color7 MediumPurple
#property indicator_color8 Silver

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
double ExtMapBuffer7[];
double ExtMapBuffer8[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(2,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexStyle(3,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(3,ExtMapBuffer4);
   SetIndexStyle(4,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(4,ExtMapBuffer5);
   SetIndexStyle(5,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(5,ExtMapBuffer6);
   SetIndexStyle(6,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(6,ExtMapBuffer7);
   SetIndexStyle(7,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(7,ExtMapBuffer8);
//----
   return(0);
  }

int deinit()
  {
   return(0);
  }

int start()
  {
   int i,j,limit,counted_bars=IndicatorCounted();
   
   
   if(counted_bars<0) return(-1);
   if(counted_bars>0) counted_bars--;
   limit=Bars-counted_bars;
   
   for(i=0; i<limit; i++){
      ExtMapBuffer1[i]=iMA(NULL,0,15,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,30,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,60,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,120,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,240,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,480,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer7[i]=iMA(NULL,0,720,0,MODE_EMA,PRICE_CLOSE,i);

      ExtMapBuffer8[i]=iMA(NULL,0,960,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

   return(0);
  }
//+------------------------------------------------------------------+

Comments