A dynamic model of the limit order book