GMMA Sashken_v1





//+------------------------------------------------------------------+
//|                        Guppy Mulitple Moving Average (Long).mq4 |
//|                                  Code written by - Matt Trigwell |
//|                                                                  |
//+------------------------------------------------------------------+

// ***** INSTRUCTIONS *****
// Add the GMMA Short indicator and the GMMA Long indicator to your charts.
// This is the GMMA Long indicator

// ***** 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



#property copyright "Code written by - Matt Trigwell"

#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 Magenta
#property indicator_color6 Magenta
#property indicator_color7 Magenta
#property indicator_color8 Magenta

extern int MaPeriod=30;
extern int Step=5;
extern int MaMode=3;
extern int Price=0;


//---- 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);
   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);
   SetIndexStyle(6,DRAW_LINE);
   SetIndexBuffer(6,ExtMapBuffer7);
   SetIndexStyle(7,DRAW_LINE);
   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,MaPeriod,0,MaMode,Price,i);
      ExtMapBuffer2[i]=iMA(NULL,0,MaPeriod+Step,0,MaMode,Price,i);
      ExtMapBuffer3[i]=iMA(NULL,0,MaPeriod+Step*2,0,MaMode,Price,i);
      ExtMapBuffer4[i]=iMA(NULL,0,MaPeriod+Step*3,0,MaMode,Price,i);
      ExtMapBuffer5[i]=iMA(NULL,0,MaPeriod+Step*4,0,MaMode,Price,i);
      ExtMapBuffer6[i]=iMA(NULL,0,MaPeriod+Step*5,0,MaMode,Price,i);
      ExtMapBuffer7[i]=iMA(NULL,0,MaPeriod+Step*6,0,MaMode,Price,i);
      ExtMapBuffer8[i]=iMA(NULL,0,MaPeriod+Step*7,0,MaMode,Price,i);
   }
   

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



Sample





Analysis



Market Information Used:



Indicator Curves created:

Implements a curve of type DRAW_LINE


Indicators Used:

Moving average indicator


Custom Indicators Used:

Order Management characteristics:

Other Features: