//+------------+ //| 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