//+------------------------------------------------------------------+
//|                                                    MAChannel.mq4 |
//|                                    Copyright © 2008, MagnumFreak |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2008, MagnumFreak"
#property link      ""

#property indicator_chart_window
#property indicator_buffers 2
#property indicator_color1 SeaGreen
#property indicator_color2 White
//---- input parameters
extern int       MA_Period=200;
extern int       Pip_Offset=100;
//---- buffers
double ExtMapBuffer1[];
double ExtMapBuffer2[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtMapBuffer1);
   SetIndexStyle(1,DRAW_LINE);
   SetIndexBuffer(1,ExtMapBuffer2);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   for(int i=counted_bars;i>=0;i--)
      {
      ExtMapBuffer1[i] = iMA(NULL,0,MA_Period,0,MODE_SMA,PRICE_CLOSE,i);
      ExtMapBuffer2[i] = ExtMapBuffer1[i] + (Pip_Offset*Point);
      }
//----
   return(0);
  }
//+------------------------------------------------------------------+