RainbowMMA_01

Download script
Author: Code written by - Akuma99
RainbowMMA_01

The Rainbow MMA 1 is a specialized visual analysis tool designed to help traders identify long-term market trends and potential price fluctuations by smoothing out "market noise." Instead of looking at the erratic second-by-second price movements, this script focuses on the broader momentum of the asset.

How the Logic Works

The core logic of this indicator relies on the calculation of Exponential Moving Averages (EMA). Unlike a simple average, an exponential moving average gives more weight to recent price data while still accounting for historical trends. This makes it highly responsive to new information without being overly reactive to minor price spikes.

The script performs the following actions:

  • Multi-Layered Smoothing: The indicator calculates six distinct moving averages simultaneously. Each of these averages uses a different "look-back" period, ranging from 175 to 200 units. By using a spectrum of values rather than just one, the tool provides a comprehensive view of how price momentum is shifting across different timeframes.
  • Price Tracking: The logic specifically monitors the Closing Price of each candle (or bar). By focusing on where the price eventually settles for each period, the indicator filters out the "whipsaw" action that occurs during high-volatility trading sessions.
  • Visual Convergence and Divergence: On your chart, these six averages appear as a series of lines. The primary goal is to observe how these lines interact with one another:
    • Alignment: When the lines are grouped closely together, it often suggests a period of consolidation or a transition in the market.
    • Expansion: When the lines fan out (like a rainbow), it indicates a strong trending move where the price is accelerating in a specific direction.
    • Crossovers: The relative positioning of these six lines helps traders identify shifts in momentum, providing a clearer picture of whether the market is gaining strength or losing steam.

Summary for the Trader

Essentially, this script acts as a "trend filter." By plotting multiple moving averages across a wide range of periods, it creates a visual map of the market's trajectory. It allows you to see the "big picture" of where the price has been and where the underlying momentum is heading, helping you stay aligned with the dominant trend rather than getting caught up in temporary price fluctuations.

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

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

//---- 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,175,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,180,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,185,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,190,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,195,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,200,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

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

Comments