In the case of selling shares: You have buyers and sellers. If you put in an order to sell, with no buyer matching at your price, nothing will happen. If another buyer comes along with a slightly higher offer (still not matching your selling price) and another seller appear that is prepared to accept whatever this buyer or the previous one (if no higher bidder appeared) is offering, this seller will match first. When two sellers are prepared to accept the offer price, the one that place the selling order first will be the first to sell his/her shares. In the case of buying shares, it is the same as described above but the replace buyers with sellers and sellers with buyers.