test bars 5_v1





//+------------------------------------------------------------------+
//| test 5.mq4                                                       |
//+------------------------------------------------------------------+
#property copyright "Ron T"
#property link      "http://www.lightpatch.com"

// in chart window, or seperate window 
#property indicator_chart_window

// buffer allocation and color for lines
#property indicator_buffers 2
#property indicator_color1 White
#property indicator_color2 White

// actual buffer array 
double ExtMapBuffer1[];
double ExtMapBuffer2[];

// ???
int ExtCountedBars=0;

// external user input (CHECK FOR ERRORS!!)
extern double indChange=0.01;


//+------------------------------------------------------------------+
//| Custom indicator init                                            |
//|------------------------------------------------------------------|
int init()
  {

   // line properties

   SetIndexStyle(0,DRAW_ARROW);
   SetIndexBuffer(0, ExtMapBuffer1);
   SetIndexArrow(0,159);
   
   SetIndexStyle(1,DRAW_ARROW);
   SetIndexBuffer(1, ExtMapBuffer2);
   SetIndexArrow(1,159);

   return(0);
  }


//+------------------------------------------------------------------+
//| Custor indicator deinit function                                 |
//+------------------------------------------------------------------+
int deinit()
   {
   return(0);
   }


//+------------------------------------------------------------------+
//| Custom indicator iteration function                              |
//+------------------------------------------------------------------+
int start()
  {
     double sum=0;
     double oldsum=0;
     double change=0;
     double hitot=0;         // must start at lowest point
     double lotot=9999;      // must start at highest point 

     int    i;
     int pos=5;

   if(Bars<=10) return(0);
   ExtCountedBars=IndicatorCounted();
   if (ExtCountedBars<0) return(-1);
   if (ExtCountedBars>0) ExtCountedBars--;

   while ( pos >= 0 )
      {
      ExtMapBuffer1[pos]=Close[pos];
      pos--;
      }
      
        



      
//---- zero initial bars
   if(ExtCountedBars<1)
      {
      for(i=1;i<5;i++) ExtMapBuffer1[Bars-i]=0;
      for(i=1;i<5;i++) ExtMapBuffer2[Bars-i]=0;
      }

      
   return(0);
  }
  
//+------------------------------------------------------------------+



Sample





Analysis



Market Information Used:

Series array that contains close prices for each bar


Indicator Curves created:

Implements a curve of type DRAW_ARROW


Indicators Used:



Custom Indicators Used:

Order Management characteristics:

Other Features: