RainbowMMA_06
Download scriptThe Rainbow MMA 1 is a technical analysis tool designed to help traders visualize market trends by smoothing out price fluctuations. Instead of looking at raw, jagged price movements, which can often be misleading due to "noise," this indicator provides a clearer picture of the underlying momentum.
How the Logic Works
The core logic of this script relies on the use of Exponential Moving Averages (EMA). Unlike a simple average that treats all past data equally, an exponential moving average gives more weight to the most recent price action. This allows the indicator to react more quickly to new information while still maintaining a smooth trajectory.
The "Rainbow" effect is achieved by calculating six distinct moving averages simultaneously. Each of these lines represents a different look-back period:
- The script calculates six specific intervals (ranging from 53 to 68 units).
- By layering these six different averages onto your chart, the tool creates a visual "bundle" or "ribbon" of data.
What This Means for Trading
When you use this indicator, you aren't just looking at one line; you are looking at a collective flow of price history.
- Trend Identification: When these lines move in the same direction and stay tightly grouped together, it indicates a strong, cohesive trend in the market.
- Momentum Support: The ribbon acts as a visual guide. When the price moves away from the bundle and then returns toward it, the lines can often act as areas of support or resistance.
- Market Volatility: By observing how much space exists between the six lines, a trader can get a sense of market sentiment. A wide spread may suggest high volatility, while a tight cluster suggests a stable, steady trend.
In essence, this tool simplifies complex data into a clean, visual summary, allowing you to see the "big picture" of market direction at a glance.
/*
*********************************************************************
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 Lime
#property indicator_color2 Lime
#property indicator_color3 Lime
#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,53,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer2[i]=iMA(NULL,0,56,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer3[i]=iMA(NULL,0,59,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer4[i]=iMA(NULL,0,62,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer5[i]=iMA(NULL,0,65,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer6[i]=iMA(NULL,0,68,0,MODE_EMA,PRICE_CLOSE,i);
}
return(0);
}
//+------------------------------------------------------------------+
Comments