//+------------------------------------------------------------------+
//|                                                     MA_Shade.mq4 |
//|                                                           oromek |
//|                                                oromeks@gmail.com |
//+------------------------------------------------------------------+
#property copyright "oromek"
#property link      "oromeks@gmail.com"
#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 clrPaleGreen
#property indicator_color2 clrPaleVioletRed
#property indicator_width1 1
#property indicator_width2 1
#property indicator_style1 STYLE_DOT
#property indicator_style2 STYLE_DOT

extern int MA1_Period = 17;
//extern string MA_Method_Help1="0-SMA, 1-EMA, 2-SMMA, 3-LWMA";
extern ENUM_MA_METHOD MA1_Method= MODE_EMA;
extern ENUM_APPLIED_PRICE MA1_Price = PRICE_CLOSE;
extern int MA1_Shift = 26;

extern int MA2_Period = 52;
//extern string MA_Method_Help2="0-SMA, 1-EMA, 2-SMMA, 3-LWMA";
extern ENUM_MA_METHOD MA2_Method= MODE_EMA;
extern ENUM_APPLIED_PRICE MA2_Price = PRICE_CLOSE;
extern int MA2_Shift = 26;

double MA1_Buffer[], MA2_Buffer[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int OnInit()
  {
   SetIndexStyle(0,DRAW_HISTOGRAM);
   SetIndexBuffer(0,MA1_Buffer);
   
   SetIndexStyle(1,DRAW_HISTOGRAM);
   SetIndexBuffer(1,MA2_Buffer);
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
   
   int limit=Bars-counted_bars;
   if(counted_bars>0) limit++;
   
   for(int i=1; i<limit; i++)
   {
      MA1_Buffer[i]=iMA(NULL,0,MA1_Period,0,MA1_Method,MA1_Price,MA1_Shift+i);
      MA2_Buffer[i]=iMA(NULL,0,MA2_Period,0,MA2_Method,MA2_Price,MA2_Shift+i);
   }
   return(0);
  }
//+------------------------------------------------------------------+