How to define last tick?

 
Hello guys, i need programme this: IF LAST TICK > 2 pips = ................. (5 digits brooker) how can i do it? thank you.
 

Maybe . . .

static double LastTickValue = 0;

if (LastTickValue == 0) LastTickValue = Bid;
else 
   {
   if (Bid > LastTickValue + (2 * DigitAdjust * Point) )   //2 pips adjusted for 4/5 digit brokers using DigitAdjust
      {
           // do stuff   
      }
   }
   
Reason: