A_GMMA Long

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

The XXGMMA indicator is a technical analysis tool designed to provide traders with a comprehensive overview of market trends by utilizing multiple moving averages simultaneously. Rather than relying on a single data point, this script calculates eight distinct Exponential Moving Averages (EMAs) to create a layered visual representation of price action.

Core Logic and Functionality

The primary objective of this indicator is to track price momentum across various time horizons. It achieves this by analyzing the closing prices of assets and applying specific mathematical smoothing to identify trends. The logic operates as follows:

  • Multi-Layered Trend Analysis: The script calculates eight different moving averages with varying periods: 144, 60, 55, 50, 45, 40, 35, and 30. By using these specific intervals, the tool allows traders to see both long-term structural trends (the larger numbers) and shorter-term price fluctuations (the smaller numbers).
  • Exponential Weighting: The indicator specifically uses the "Exponential" method. Unlike a simple average, this logic gives more importance to the most recent price data. This makes the indicator more responsive to sudden market changes while still maintaining a smooth line that filters out minor "noise."
  • Visual Convergence and Divergence: Because the script plots all eight averages on the same chart window, it allows users to observe how different trend lines interact. When these lines cluster together, it often signals a period of consolidation or a potential breakout; when they spread apart, it highlights the strength and direction of the current momentum.
  • Real-Time Updating: The script is designed to process every historical bar on the chart and update automatically as new price data arrives. This ensures that the visual representation of the trend remains current and accurate for live trading decisions.

Summary for Traders

In practical terms, this indicator serves as a "ribbon" or a collection of trend layers. By looking at the relative positions of these eight lines, you can better gauge the market's sentiment—helping to identify whether the overall trend is accelerating, slowing down, or reversing based on how many of these different timeframes are aligning in the same direction.

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

*********************************************************************
          
                              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 Red
#property indicator_color2 Red
#property indicator_color3 Red
#property indicator_color4 Red
#property indicator_color5 Red
#property indicator_color6 Red
#property indicator_color7 Red
#property indicator_color8 Red

//---- 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,1);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE,EMPTY,2);
   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,144,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i]=iMA(NULL,0,60,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer3[i]=iMA(NULL,0,55,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer4[i]=iMA(NULL,0,50,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer5[i]=iMA(NULL,0,45,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer6[i]=iMA(NULL,0,40,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer7[i]=iMA(NULL,0,35,0,MODE_EMA,PRICE_CLOSE,i);
      ExtMapBuffer8[i]=iMA(NULL,0,30,0,MODE_EMA,PRICE_CLOSE,i);
   }
   

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

Comments