A_GMMA Short

Download script
Author: Modified by Accrete for use in XXGMMA
A_GMMA Short

This script is a technical analysis tool designed to help traders visualize market trends by calculating and plotting multiple moving averages simultaneously on a single price chart. Instead of relying on one single average, it creates a multi-layered visual representation of the market's momentum.

Core Functionality

The logic operates by tracking eight different "Exponential Moving Averages" (EMAs). Unlike a simple moving average, an exponential average places more importance on recent price action, making it more responsive to sudden market changes. The script calculates these averages based on the closing prices of various time periods.

How It Works

The tool processes a series of specific time frames—ranging from short-term (3 periods) to longer-term (21 periods)—to provide a comprehensive view of the price movement:

  • Short-Term Sensitivity: By including very fast averages (such as 3, 5, and 8 periods), the script highlights immediate price fluctuations and rapid momentum shifts.
  • Mid-Range Momentum: The middle layers (10, 12, and 15 periods) help identify the established "flow" of the current trend.
  • Longer-Term Foundation: The slowest averages (18 and 21 periods) provide a broader context, showing the overall direction of the market over a larger span of time.

Visual Output

When applied to a chart, the script renders these eight different calculations as distinct lines. By observing how these lines interact—whether they are clustered together, spreading apart, or crossing one another—traders can better identify potential trend reversals, breakouts, or periods of high volatility. It essentially transforms raw price data into a multi-layered "ribbon" that clarifies the relationship between immediate price action and historical trends.

Indicators Used
Moving average indicator
Miscellaneous
Implements a curve of type %1
13 Views
0 Downloads
0 Favorites
A_GMMA Short
/*

*********************************************************************
          
                              XXGMMA
                   Copyright © 2006  Accrete
                  
*********************************************************************

*/


#property copyright "Code written by - Akuma99 at http://www.beginnertrader.com"
#property copyright "Modified by Accrete for use in XXGMMA"

#property indicator_chart_window
#property indicator_buffers 8
#property indicator_color1 Blue
#property indicator_color2 Blue
#property indicator_color3 Blue
#property indicator_color4 Blue
#property indicator_color5 Blue
#property indicator_color6 Blue
#property indicator_color7 Blue
#property indicator_color8 Blue

//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];
double ExtMapBuffer6[];
double ExtMapBuffer7[];
double ExtMapBuffer8[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,EMPTY,2);
   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);
   SetIndexStyle(6,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(6,ExtMapBuffer7);
   SetIndexStyle(7,DRAW_LINE,EMPTY,1);
   SetIndexBuffer(7,ExtMapBuffer8);
   

//----
   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,21,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,18,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,15,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,12,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,10,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,8,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer7[i]=iMA(NULL,0,5,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer8[i]=iMA(NULL,0,3,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

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

Comments