GMMA Short_v2
Download scriptThis script is designed to function as a specialized technical analysis tool for trading platforms, specifically focusing on the "Short" component of the Guppy Multiple Moving Average (GMMA) strategy. Its primary purpose is to help traders visualize short-term price momentum and trends by tracking the rapid movements of the market.
How the Logic Works
The core logic of this script relies on calculating five distinct "Exponential Moving Averages" (EMAs). Unlike a simple average that treats all past data points equally, an exponential moving average places more weight on the most recent price data. This makes it highly responsive to current market shifts.
Specifically, this script calculates five different versions of these averages based on varying timeframes: 3, 7, 10, 12, and 15 periods. By using these specific intervals, the tool creates a "bundle" of lines that react quickly to price fluctuations.
Visual Interpretation and Purpose
Instead of looking at just one line to decide where the price is going, this script allows you to see a group of five lines working in tandem. This provides several insights for a trader:
- Momentum Tracking: Because these are "Short" term averages, they are intended to highlight immediate trends. When these lines move together, they indicate a strong collective sentiment in the market over a very brief window.
- Trend Confirmation: By observing the "thickness" or "spread" of these five lines, you can gauge the strength of a move. If the lines are tightly grouped and moving upward, it suggests a confident short-term bullish trend.
- Visual Clarity: The script renders all five averages in a consistent color (Lime Green), allowing you to see them as a unified group. This is intended to be used alongside a "Long" version of the GMMA indicator to identify broader market trends and potential entry or exit points based on how the short-term sentiment interacts with the long-term trend.
In summary, this script acts as a high-speed radar for price action, filtering out minor "noise" while providing a clear visual representation of the immediate direction the market is taking.
//+------------------------------------------------------------------+
//| 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
// ***** 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"
#property indicator_chart_window
//#property indicator_separate_window
#property indicator_buffers 5
#property indicator_color1 LimeGreen
#property indicator_color2 LimeGreen
#property indicator_color3 LimeGreen
#property indicator_color4 LimeGreen
#property indicator_color5 LimeGreen
//---- 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