GMMA Long_v1
Download scriptThis tool is designed to provide traders with a visual representation of market trends by utilizing a sophisticated moving average strategy known as the Guppy Multiple Moving Average (GMMA). Specifically, this script focuses on the "Long" component of that strategy, which helps identify broader, long-term market momentum.
How the Logic Works
The core logic of this script relies on calculating six distinct Exponential Moving Averages (EMAs) simultaneously. Unlike a single moving average that only gives you one perspective on price, this script looks at different time horizons to create a "ribbon" effect on your chart.
Each of the six lines represents a different level of historical data:
- The first three lines calculate averages over shorter periods (30, 35, and 40 intervals).
- The remaining three lines calculate averages over slightly longer periods (45, 50, and 60 intervals).
How to Interpret the Data
By layering these six moving averages together, the script creates a visual "cluster." Because they are all based on exponential data—which places more importance on recent price action—the lines will move in relative harmony with one another.
- Trend Identification: When these lines move upward together, it indicates a sustained bullish trend. Conversely, when they trend downward as a group, it signals a bearish sentiment.
- Market Momentum: The proximity and "tightness" of the lines can tell you how strong the current trend is. When the lines are grouped closely, it often suggests a period of consolidation or a very stable trend.
- Support and Resistance: In a trending market, this cluster of moving averages acts as a dynamic zone of support or resistance. Traders often look for the price to stay above or below this "ribbon" to confirm the strength of the current market direction.
In summary, instead of relying on one single line to tell you what the price is doing, this script provides a multi-layered view that helps smooth out market "noise," allowing you to see the underlying trend more clearly.
//+------------------------------------------------------------------+
//| Guppy Mulitple Moving Average (Long).mq4 |
//| Code written by - Matt Trigwell |
//| |
//+------------------------------------------------------------------+
// ***** INSTRUCTIONS *****
// Add the GMMA Short indicator and the GMMA Long indicator to your charts.
// This is the GMMA Long indicator
// ***** For information on how to use this fantastic indicator *****
// http://www.guppytraders.com/
// http://www.market-analyst.com/kb/article.php/Guppy_Multiple_Moving_Average
// http://tradermike.net/2004/05/another_look_at_multiple_moving_averages
#property copyright "Code written by - Matt Trigwell"
#property indicator_chart_window
#property indicator_buffers 6
#property indicator_color1 Blue
#property indicator_color2 Blue
#property indicator_color3 Blue
#property indicator_color4 Blue
#property indicator_color5 Blue
#property indicator_color6 Blue
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_LINE);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle(4,DRAW_LINE);
SetIndexBuffer(4,ExtMapBuffer5);
SetIndexStyle(5,DRAW_LINE);
SetIndexBuffer(5,ExtMapBuffer6);
//----
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,30,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer2[i]=iMA(NULL,0,35,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer3[i]=iMA(NULL,0,40,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer4[i]=iMA(NULL,0,45,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer5[i]=iMA(NULL,0,50,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer6[i]=iMA(NULL,0,60,0,MODE_EMA,PRICE_CLOSE,i);
}
return(0);
}
//+------------------------------------------------------------------+
Comments