Say a security has been trading at under $20.10, and there are limit orders selling at $20.10 and $20.21. Then Simon issues a limit order to buy at $20.21. According to this explanation, Simon would end up buying shares at $20.10.
Why does the exchange favor the buyer here? I.e., why does the transaction execute at the seller's limit of $20.10 instead of the buyer's limit of $20.21? (I.e., why don't Inara/River get to sell at $20.21 / above their limit, but Simon gets to buy at $20.10 / below his limit?) Is the example flawed?
If it makes a difference, I'm mainly curious about NASDAQ and NYSE. I tried Googling for specs (e.g. this), but couldn't find anything. Only found that some random limit order bookimplementation executes the average of the buy/ask. Just curious how the system works mybkexperience.