RainbowMMA_04

Download script
Author: Code written by - Akuma99
RainbowMMA_04

The Rainbow MMA 1 is a visual trading tool designed to help market participants identify long-term trends and price momentum by smoothing out market "noise." Rather than looking at the erratic second-by-second price fluctuations, this indicator provides a clearer picture of the underlying direction of the asset.

How the Logic Works

The core functionality of this script relies on a multi-layered approach using Exponential Moving Averages (EMA). Unlike a standard simple average, an EMA places more importance on recent price data while still accounting for historical movement, making it highly responsive to current market shifts.

Specifically, the script calculates six different moving averages simultaneously, each based on a specific "look-back" period:

  • 94 periods
  • 98 periods
  • 102 periods
  • 106 periods
  • 110 periods
  • 114 periods

Visual Representation and Purpose

By calculating these six distinct averages and plotting them on your chart, the tool creates a "ribbon" or "rainbow" effect. Because each line is based on a slightly different timeframe (ranging from 94 to 114 units of price data), they do not overlap perfectly.

The primary benefits for the user include:

  • Trend Identification: When these lines move in a specific direction together, it signals a cohesive trend in the market.
  • Momentum Observation: The "spread" or width between the lines can indicate how strong or weak the current price momentum is. If the lines are tightly clustered, the market may be consolidating; if they fan out widely, it suggests a strong move in one direction.
  • Visual Filtering: By providing multiple layers of data, the indicator helps traders ignore minor price spikes that could lead to "false starts," allowing for a more disciplined approach to analyzing price action.

In summary, this tool serves as a sophisticated visual guide that translates complex historical price data into a smooth, multi-layered ribbon, helping you see the "big picture" of the market's trajectory.

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

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

//---- 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,94,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,98,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,102,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,106,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,110,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,114,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

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

Comments