//+------------------------------------------------------------------+
//|                                                ma montenegro.mq4 |
//|                                                          ......h |
//|                                                    hayseedfx.com |
//+------------------------------------------------------------------+   //http://www.forexfactory.com/showthread.php?t=272962  //http://www.discover-montenegro.com/Activities.htm
#property copyright "......h"
#property link      "hayseedfx.com"

#property indicator_separate_window

#property indicator_buffers 5

extern string first         = "ma settings";
extern int    periods1      =       2;
extern int    type1         =       0;
extern int    price1        =       0;
extern color  color1        =  Yellow;

extern string second        = "ma settings";
extern int    periods2      =       4;
extern int    type2         =       1;
extern int    price2        =       0;
extern color  color2        =  Yellow;

extern string third         = "ma settings";
extern int    periods3      =       8;
extern int    type3         =       2;
extern int    price3        =       0;
extern color  color3        =    Aqua;

extern string fourth        = "ma settings";
extern int    periods4      =      10;
extern int    type4         =       2;
extern int    price4        =       0;
extern color  color4        =    Aqua;


extern string alf           = "alf settings below";
extern int    LookBack      =       4;
extern int    Median        =       5;
extern color  alfcolor      =   White;

double ExtMapBuffer1[];
double ExtMapBuffer2[];
double ExtMapBuffer3[];
double ExtMapBuffer4[];
double ExtMapBuffer5[];


int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE,EMPTY,1,color1);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE,EMPTY,1,color2);
   SetIndexBuffer(1,ExtMapBuffer2);
   SetIndexStyle(2,DRAW_LINE,EMPTY,1,color3);
   SetIndexBuffer(2,ExtMapBuffer3);
   SetIndexStyle(3,DRAW_LINE,EMPTY,1,color4);
   SetIndexBuffer(3,ExtMapBuffer4);
   SetIndexStyle(4,DRAW_LINE,EMPTY,3,alfcolor);
   SetIndexBuffer(4,ExtMapBuffer5);
   
   return(0);
  }

int deinit()
  {
   return(0);
  }

int start()
  {
   int i,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,periods1,0,type1,price1,i);
      ExtMapBuffer2[i]=iMA(NULL,0,periods2,0,type2,price2,i);
      ExtMapBuffer3[i]=iMA(NULL,0,periods3,0,type3,price3,i);
      ExtMapBuffer4[i]=iMA(NULL,0,periods4,0,type4,price4,i);
      ExtMapBuffer5[i]=iCustom(NULL,0,"alf",LookBack,Median,4,Blue,0,i);      
      }
   return(0);
   }
//+------------------------------------------------------------------+