//+------------------------------------------------------------------+
//|                                                        Range.mq4 |
//|                              (c) Copyright 2011-2013 David Keene |
//|                                                                  |
//+------------------------------------------------------------------+
#property copyright "(c) Copyright 2011-2013 David Keene"
#property link      ""

#property indicator_separate_window
#property indicator_minimum 0
#property indicator_buffers 1
#property indicator_color1 Black
//--- buffers
double ExtMapBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- indicators
   SetIndexStyle(0,DRAW_HISTOGRAM, STYLE_SOLID, 2);
   SetIndexBuffer(0,ExtMapBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int    counted_bars=IndicatorCounted();
//----
   int i = Bars-counted_bars - 1;
   
   while (i >= 0)
   {
   	ExtMapBuffer1[i] = MathAbs(High[i]-Low[i]);
   	i--;
   }
  
   
//----
   return(0);
  }
//+------------------------------------------------------------------+