GMMA Short
Download scriptThis script is a technical analysis tool designed for the MetaTrader trading platform. It functions as a specialized visual aid that helps traders identify short-term market trends and momentum by plotting multiple moving averages simultaneously on a price chart.
Core Logic and Functionality
The primary purpose of this indicator is to simplify "market noise" by smoothing out price fluctuations. Instead of looking at the raw, erratic movement of an asset's price (like a stock or currency pair), this script calculates five distinct "Exponential Moving Averages" (EMAs).
How it works:
- Multi-Layered Analysis: The script tracks five different timeframes simultaneously: 3, 7, 10, 12, and 15 periods. By using a variety of short-term windows, the indicator provides a more comprehensive view of current market sentiment than a single average line could offer.
- Exponential Weighting: Because it uses "Exponential" moving averages, the logic gives more importance to the most recent price data. This ensures that the indicator reacts quickly to new information while still maintaining a smooth curve.
- Trend Visualization: Each of the five averages is plotted as a line on your chart. When these lines cluster together and move in the same direction, it signals a strong, unified trend. Conversely, if the lines begin to spread out or cross one another significantly, it suggests increasing volatility or a potential shift in momentum.
Purpose for the Trader
This specific version is categorized as the "Short" component of the Guppy Multiple Moving Average strategy. It is intended to be used in conjunction with a "Long" version to help traders identify:
- Momentum: How fast and how strongly the price is moving in a specific direction.
- Support and Resistance: Areas where the various averages converge may act as "floors" or "ceilings" for price action.
- Trend Alignment: By observing all five lines at once, traders can more easily see if the short-term trend is gaining strength or beginning to fatigue.
//+------------------------------------------------------------------+
//| Guppy Mulitple Moving Average (Short).mq4 |
//| Code written by - Matt Trigwell |
//| |
//+------------------------------------------------------------------+
// ***** 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
// ***** INSTRUCTIONS *****
// Add the GMMA Short indicator and the GMMA Long indicator to your charts.
// This is the GMMA Short indicator
#property copyright "Code written by - Matt Trigwell and modified by Ozkan Karakoyunlar"
#property indicator_chart_window
//#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 Lime
#property indicator_color2 Lime
#property indicator_color3 Lime
#property indicator_color4 Lime
#property indicator_color5 Lime
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function |
//+------------------------------------------------------------------+
int init()
{
//---- indicators
SetIndexStyle(0,DRAW_LINE,EMPTY,1,indicator_color1);
SetIndexBuffer(0,ExtMapBuffer1);
SetIndexStyle(1,DRAW_LINE,EMPTY,1,indicator_color2);
SetIndexBuffer(1,ExtMapBuffer2);
SetIndexStyle(2,DRAW_LINE,EMPTY,1,indicator_color3);
SetIndexBuffer(2,ExtMapBuffer3);
SetIndexStyle(3,DRAW_LINE,EMPTY,1,indicator_color4);
SetIndexBuffer(3,ExtMapBuffer4);
SetIndexStyle(4,DRAW_LINE,EMPTY,1,indicator_color5);
SetIndexBuffer(4,ExtMapBuffer5);
//----
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,3,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer2[i]=iMA(NULL,0,7,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer3[i]=iMA(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer4[i]=iMA(NULL,0,12,0,MODE_EMA,PRICE_CLOSE,i);
ExtMapBuffer5[i]=iMA(NULL,0,15,0,MODE_EMA,PRICE_CLOSE,i);
}
return(0);
}
//+------------------------------------------------------------------+
Comments