Var3 = (RectanglePriceMax - RectanglePriceMin)/Stage;

this will definitely get you the difference in pips. How you had it before the value could always be less than 50.