RainbowMMA_03

Download script
Author: Code written by - Akuma99
RainbowMMA_03

The Rainbow MMA 1 is a visual trading tool designed to help market participants identify and track long-term price trends by smoothing out the "noise" of everyday price fluctuations. It achieves this by calculating several different moving averages simultaneously on your chart.

How it Works

The core logic of this script involves tracking the average closing price of an asset over various time intervals. Instead of showing you just one line, it generates a bundle of six distinct Exponential Moving Averages (EMAs). Each of these averages uses a slightly different look-back period:

  • Short-Term Sensitivity: The first two lines are calculated using shorter periods (118 and 122 units), which react more quickly to recent price changes.
  • Long-Term Stability: The remaining four lines use progressively larger periods (ranging from 125 up to 140 units). These act as a "base" for the trend, moving much more slowly and steadily than the shorter lines.

Visual Interpretation

By plotting these six lines together, the indicator creates a "rainbow" or "ribbon" effect on your chart. The primary purpose of this logic is to provide visual cues regarding market momentum:

  • Trend Identification: When all the lines are moving in the same direction (e.g., angling upward), it suggests a strong prevailing trend.
  • Momentum Strength: The width or "spread" between the lines can indicate how much volatility or strength is behind a move. When the lines are tightly clustered, it may suggest consolidation; when they fan out significantly, it indicates accelerating momentum.
  • Support and Resistance: Because these are moving averages based on historical prices, the space between the lines often acts as a dynamic zone where price may find temporary support or face resistance during a trend.

Essentially, this tool transforms complex price history into a simplified visual map, allowing you to see the broader "flow" of the market at a single glance.

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

*********************************************************************
          
                        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 Red
#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,118,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,122,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,125,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,130,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,135,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,140,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

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

Comments