//+------------------------------------------------------------------+
//|                                            ZenhorstIndicator.mq4 |
//|                                                  Oleg Kovalichin |
//|                                           http://www.fxpro.co.uk |
//+------------------------------------------------------------------+
#property copyright "Oleg Kovalichin"
#property link      "http://www.fxpro.co.uk"

#property indicator_separate_window
#property indicator_color1 Green

extern int Scalar = 10000;

double ExtBuffer1[];
//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
   SetIndexStyle(0,DRAW_LINE);
   SetIndexBuffer(0,ExtBuffer1);
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator deinitialization function                       |
//+------------------------------------------------------------------+
int deinit()
  {
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
   int i = Bars - IndicatorCounted() - 1;
   
   double devisor;   
      
   while(i >= 0)
   {   
   
      devisor = High[i] - Low[i];
      if(devisor != 0) ExtBuffer1[i] = Volume[i]/Scalar/devisor;
      else ExtBuffer1[i] = EMPTY_VALUE;
   
    i--;
   }
   
//----
   
//----
   return(0);
  }
//+------------------------------------------------------------------+