TLDR: Market orders are filled even if there is nothing in the order book. Should this be the correct behaviour?

I am testing an options strategy that makes Market orders. At the time I make the market order I also log the current Bid/Ask prices. It seems the market order is marked as filled at the current best Ask price, even if there isn't any Bids. This seems very unrealistic that we assume we immedately get filled at the current best Ask, even if there is no bid.

Example from my logs:

2018-02-12 09:31:00 : Bid/Ask 0.0/2.9
2018-02-12 09:31:00 : Time: 2/12/2018 2:31:00 PM OrderID: 5 Symbol: GOOG 180216C01197500 Status: Submitted
2018-02-12 09:31:00 : Time: 2/12/2018 2:31:00 PM OrderID: 5 Symbol: GOOG 180216C01197500 Status: Filled Quantity: -1 FillPrice: 2.9 USD OrderFee: 1 USD

 

Now, if there is a bid price, then the market order uses the best bid as the fill price, which sounds realistic.

So I'm wondering. Is this the expected behaviour? If so, should this be changed?

For completeness, here is also an extract from my logs when there is a bid price, in which case the market order is filled at the bid:

2018-02-12 09:31:00 : Bid/Ask 0.05/1.0
2018-02-12 09:31:00 : Time: 2/12/2018 2:31:00 PM OrderID: 6 Symbol: GOOG 180216P00900000 Status: Submitted
2018-02-12 09:31:00 : Time: 2/12/2018 2:31:00 PM OrderID: 6 Symbol: GOOG 180216P00900000 Status: Filled Quantity: -1 FillPrice: 0.05 USD OrderFee: 1 USD

 

Author