RainbowMMA_09

Author: Code written by - Akuma99
RainbowMMA_09

The Rainbow MMA 1 is a visual trading tool designed to help market participants identify trends by analyzing price movements over different timeframes simultaneously. Instead of looking at just one moving average, this indicator overlays multiple "Moving Averages" (MAs) onto your chart, creating a multi-layered visualization of the market's momentum.

How it Works

The core logic of this script relies on calculating Exponential Moving Averages (EMAs). Unlike simple averages, exponential averages give more weight to recent price data, allowing the indicator to react more quickly to new market developments while still filtering out minor "noise."

The script calculates six distinct EMA lines based on different periods: 14, 15, 17, 19, 21, and 23. By using these specific intervals, the tool creates a "cluster" of data points that follow the price action.

Visual Interpretation

The indicator differentiates between these averages using color coding to help you distinguish between different types of market signals:

  • Gold Lines: These represent the primary layers of the moving average cluster. They serve as the immediate visual reference for the current trend's trajectory.
  • DeepSkyBlue Lines: The remaining lines provide a broader context. When these lines group together in a specific direction, they reinforce the strength of the trend.

Practical Application

The "Rainbow" effect occurs when these various moving averages converge or diverge:

  1. Trend Identification: When all lines are sloping upward and clustered together, it suggests a strong bullish (upward) trend. When they slope downward, it indicates a bearish (downward) trend.
  2. Momentum Strength: The tighter the "rainbow" of lines stays together, the more stable the current trend is.
  3. Potential Reversals: If you see the lines beginning to fan out significantly or cross over one another, it may signal a loss of momentum or a potential shift in the market's direction.

In summary, this tool simplifies complex data by smoothing out price fluctuations and providing a visual "map" of where the market is heading, allowing for easier trend detection at a glance.

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

*********************************************************************
          
                        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 Gold
#property indicator_color2 Gold
#property indicator_color3 DeepSkyBlue
#property indicator_color4 DeepSkyBlue
#property indicator_color5 DeepSkyBlue
#property indicator_color6 DeepSkyBlue
#property indicator_color7 DeepSkyBlue
#property indicator_color8 DeepSkyBlue

//---- 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,14,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,15,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,17,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,19,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,21,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,23,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

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

Comments