Last three prices

 
Can anyone tell me how to get and compare the last three prices (ask or bid)?
 
I did it with global varables... Well, I made it so I can count the consecutive upticks and downticks...Back when, I used to sit in front of the monitor and watch the prices as they came up and went more by that than the indicators. . most of the time a rally will start out with a flurry of buys or sells, so I stuck this counter into one of my experts and limited the trades to when there were at least three upticks for buying and at least three down for selling... we'll see...
 
The idea of using a tick counter is good... But trading based on last 3 ticks is VERY VERY WRONG ... commonly known as scalping