GMMA Long
Download scriptThis tool is designed to work as a visual aid on your trading charts to help identify market trends by analyzing price momentum. It utilizes a specific technical analysis method known as the Guppy Multiple Moving Average (GMMA) strategy, specifically configured for "Long" perspective analysis.
How the Logic Works
Instead of looking at a single average price, this script calculates and plots six different moving averages simultaneously. By tracking multiple timeframes at once, it helps traders distinguish between short-term "noise" and long-term market direction.
The core logic follows these steps:
- Data Collection: The script looks at the closing prices of a financial asset over specific historical periods.
- Exponential Smoothing: It uses an "Exponential Moving Average" (EMA) calculation. Unlike a simple average, the EMA gives more weight to recent price action, allowing the lines on your chart to react more quickly to new market developments while still maintaining the overall trend.
- Tiered Timeframes: The script generates six distinct lines based on different look-back periods: 30, 35, 40, 45, 50, and 60 units of time (such as bars or candles).
- Visual Convergence: By plotting these six lines together, the goal is to observe how they interact. When these averages cluster together and move in the same direction, it suggests a strong trend is forming. When they spread out or cross one another, it can signal potential volatility or a shift in market sentiment.
Practical Application for Traders
When you add this indicator to your chart, you are essentially looking at a "bundle" of trends. Because this specific script is the "Long" version, it is intended to help you visualize the underlying health of the trend. By watching how these six red lines move in harmony, you can get a clearer picture of whether the market is gaining momentum or cooling off, providing a more comprehensive view than any single indicator could offer alone.
//+------------------------------------------------------------------+
//| 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
// http://karakoyunlar.blogspot.com
#property copyright "Code written by - Matt Trigwell and modified by Ozkan Karakoyunlar"
#property indicator_chart_window
//#property indicator_separate_window
#property indicator_buffers 6
#property indicator_color1 Red
#property indicator_color2 Red
#property indicator_color3 Red
#property indicator_color4 Red
#property indicator_color5 Red
#property indicator_color6 Red
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
//+------------------------------------------------------------------+
//| 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);
//----
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