Author: Code written by - Matt Trigwell
GMMAShort6

This script functions as a specialized technical analysis tool designed to help traders visualize short-term market trends. It operates by calculating and displaying six different "Exponential Moving Averages" (EMAs) simultaneously on a single price chart.

Core Logic and Functionality

The primary objective of this indicator is to smooth out the "noise" of raw price action to reveal underlying momentum. Instead of looking at a single average price, it creates a bundle of six distinct lines, each reacting to different timeframes of recent price history.

The logic follows these specific steps:

  • Timeframe Variety: The script calculates averages based on six specific intervals: 3, 5, 8, 10, 12, and 15 periods. By using a variety of short-term windows, the tool provides a comprehensive look at how the market is behaving in the immediate moment versus the slightly broader "short-term" context.
  • Exponential Weighting: It utilizes the "Exponential" method for these averages. In non-technical terms, this means the indicator gives more importance to the most recent price data points. This allows the lines to react more quickly to sudden news or price shifts than a standard moving average would.
  • Visual Aggregation: All six resulting lines are plotted together in red. When these lines move in unison—all sloping upward or downward together—it signals a strong, synchronized trend. Conversely, when the lines begin to spread apart or tangle with one another, it indicates market hesitation or a potential shift in sentiment.

Practical Application

By providing this "bundle" of indicators, the script allows you to see the health of a short-term trend at a glance. Because it focuses on shorter timeframes (peaking at 15 periods), it is specifically engineered to identify rapid momentum changes and entry/exit points where the short-term price action is accelerating in a specific direction.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
11 Views
0 Downloads
0 Favorites
GMMAShort6
//+------------------------------------------------------------------+
//|                        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_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);
   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,3,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,8,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,12,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,15,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

   return(0);
  }
//+------------------------------------------------------------------+

Comments