MFCS ATR BAR





//+------------------------------------------------------------------+
//|                                                 MFCS ATR BAR.mq4 |
//|                                           Copyright © 2009, MFCS |
//|                                     http://www.mpatidar.com/mfcs |
//+------------------------------------------------------------------+
#property copyright "Copyright © 2009, MFCS"
#property link      "http://www.mpatidar.com/mfcs"
#property copyright "Copyright © 2009, MFCS"
#property link      "http://www.mpatidar.com/mfcs"

#property  indicator_separate_window
#property  indicator_buffers 1
#property  indicator_color1  Silver
#property  indicator_width1  4


//---- indicator parameters
extern int _Period=5;


double     SwBuffer[];

//+------------------------------------------------------------------+
//| Custom indicator initialization function                         |
//+------------------------------------------------------------------+
int init()
  {
//---- drawing settings
   SetIndexStyle(0,DRAW_HISTOGRAM);   
   IndicatorDigits(0);
//---- indicator buffers mapping
   SetIndexBuffer(0,SwBuffer);
   
//---- name for DataWindow and indicator subwindow label
   IndicatorShortName("MFCS ATR BAR(" + _Period + ")");
   SetIndexLabel(0,"ATR");
   
   SetIndexEmptyValue(0,0.0);   
   
//---- initialization done
   return(0);
  }
//+------------------------------------------------------------------+
//| Moving Averages Convergence/Divergence                           |
//+------------------------------------------------------------------+
int start()
  {
   int limit;
   int counted_bars=IndicatorCounted();
//---- last counted bar will be recounted
   if(counted_bars>0) counted_bars-=1;
   limit=Bars-counted_bars;
//---- macd counted in the 1-st buffer
   for(int i=0; i<limit; i++)
   {
      
      SwBuffer[i] = NormalizeDouble(iATR(Symbol(), Period(), _Period, i) / Point, 0);
      
      
   }
   return(0);
  }
//+------------------------------------------------------------------+






Sample





Analysis



Market Information Used:



Indicator Curves created:

Implements a curve of type DRAW_HISTOGRAM


Indicators Used:

Indicator of the average true range


Custom Indicators Used:

Order Management characteristics:

Other Features: