TickUpDown_Ron_v01a





//+------------+
//| TickUpDown |
//+------------+
#property  copyright "Copyright 2008 Ron Thompson"
#property  link      "http://www.forexmt4.com/"

/*
This indicator counts ticks up and down
*/

//---- indicator settings
#property  indicator_separate_window

#property indicator_buffers   2
#property indicator_color1  Green
#property indicator_color2  Red


//---- buffers
double B1[];  //Green
double B2[];  //Red

double currTick;
double prevTick;


// bar open handling
datetime   bartime=0;


//+-----------+
//| Init      |
//+-----------+
int init()
  {
   // 233 up arrow
   // 234 down arrow
   // 158 little dot
   // 159 big dot
   // 168 open square
   // 120 box with X

   SetIndexBuffer(0,B1);  //Green
   SetIndexStyle(0, DRAW_ARROW);
   SetIndexArrow(0,159);

   SetIndexBuffer(1,B2);  //Red
   SetIndexStyle(1, DRAW_ARROW);
   SetIndexArrow(1,159);


   Print("Init complete");
  }

//+-----------+
//| DE-Init   |
//+-----------+
int deinit()
  {
   Print("DE-Init complete");
  }


//+-----------+
//| Each Tick |
//+-----------+
int start()
  {   
   if(bartime!=iTime(Symbol(),0,0))
     {
      bartime=iTime(Symbol(),0,0);
      B1[0]=0;
      B2[0]=0;
     }    

   prevTick=currTick;
   currTick=Close[0];
   
   if(currTick>prevTick) B1[0]++;
   if(currTick<prevTick) B2[0]++;

  }//start






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: