RainbowMMA_07

Download script
Author: Code written by - Akuma99
RainbowMMA_07

The Rainbow MMA 1 is a technical analysis tool designed to provide a visual representation of market momentum and trend direction. Instead of relying on a single moving average, this indicator utilizes a multi-layered approach to help traders identify the underlying "flow" of price action more clearly.

How it Works

The logic of the script is based on calculating several different Exponential Moving Averages (EMAs) simultaneously. Each EMA looks at a slightly different timeframe of historical price data:

  • Short-term Tracking: The indicator calculates averages using shorter timeframes (starting at 37 periods), which are more sensitive to immediate price fluctuations.
  • Medium and Long-term Tracking: It then layers additional averages over progressively longer timeframes (up to 50 periods). These lines react more slowly to price changes, representing the broader market trend.

Visual Behavior

By plotting these multiple moving averages on your chart, the script creates a "rainbow" effect of overlapping lines. The primary purpose of this layering is to observe how these different timeframes interact with one another:

  1. Trend Identification: When the lines are grouped closely together and moving in the same direction, it signals a strong, established trend.
  2. Momentum Shifts: By watching the distance between the "fast" lines (the ones reacting quickly) and the "slow" lines (the ones representing the broader trend), traders can get a sense of whether the current market move is gaining strength or losing steam.
  3. Price Context: Because the indicator uses the closing price of candles to determine its values, it provides a smoothed out view of where the market has been heading, filtering out minor "noise" while still highlighting significant shifts in direction.

In summary, this script serves as a visual roadmap. It allows you to see the convergence and divergence of multiple trend cycles at once, helping you distinguish between temporary price spikes and sustained market movements.

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

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

//---- 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,37,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,39,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,41,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,44,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,47,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,50,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

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

Comments