tick up or down

 

I am trying to get a simple string showing in last tick was up or down, somehow it gets stuck in "down" position. Obviously I am missing something.. so any help will be appreciated.

Dan.

//+------------------------------------------------------------------+
//|   TICK UP OR DOWN                                                |
//+------------------------------------------------------------------+    
   
   string tickMove;
   double NewTick = Bid;
   static double OldTick = Bid;
   double Move = (NewTick - OldTick);
   if (Move > 0)  tickMove = "up";
   if (Move < 0)  tickMove = "dn";
   if (Move ==0)  tickMove = "--";
 

You never update the value of OldTick after doing your comparison.

OldTick=NewTick;
 
honest_knave:

You never update the value of OldTick after doing your comparison.

 

Correct, thanks! I moved the static at the end and had it declared in global scope.

Reason: