RainbowMMA_02
Download scriptThe Rainbow MMA 1 is a visual trading tool designed to help traders identify market trends and potential price momentum by layering multiple moving averages onto a single chart. Rather than relying on a single line to determine the direction of the market, this script provides a "ribbon" effect that helps clarify whether the current price action is accelerating or cooling down.
How the Logic Works
The core functionality of this indicator relies on the calculation of several Exponential Moving Averages (EMA) simultaneously. Unlike a simple moving average, an exponential moving average gives more weight to recent price data, making it more responsive to new market changes while still smoothing out minor fluctuations.
The script specifically tracks six different EMAs at once, each using a slightly different "look-back" period:
- 145 periods
- 150 periods
- 155 periods
- 160 periods
- 165 periods
- 170 periods
Practical Application for the User
By calculating these six values, the indicator creates a series of lines that move in close proximity to one another. For a trader, this provides several visual cues:
- Trend Identification: When these lines are stacked and moving in a consistent direction (up or down), it indicates a strong, established trend. The "spread" between the lines can show the strength of that movement.
- Momentum Tracking: Because the periods are so close together (increments of 5), the lines react to price changes almost in unison. A widening gap between the lines suggests increasing momentum, while a tightening of the lines may indicate that the current trend is losing steam or consolidating.
- Smoothing the Noise: By using these larger period averages (all above 140), the indicator filters out "market noise"—the small, erratic price jumps that occur in the short term—allowing the trader to focus on the broader market structure.
In summary, the Rainbow MMA 1 acts as a visual barometer for long-term price flow, helping you see the "big picture" of where the market is heading by grouping multiple trend indicators into one cohesive visual display.
/*
*********************************************************************
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,145,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer2[i]=iMA(NULL,0,150,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer3[i]=iMA(NULL,0,155,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer4[i]=iMA(NULL,0,160,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer5[i]=iMA(NULL,0,165,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer6[i]=iMA(NULL,0,170,0,MODE_EMA,PRICE_CLOSE,i);
}
return(0);
}
//+------------------------------------------------------------------+
Comments