Alpaca limit orders not executing in paper account

The following limit buy orders did not execute in the paper account despite being submitted at the start of the minute and their limit price being better than the low during that minute, as illustrated by the included minute bar data. Note that the orders include pre-market, regular-hours and after-hours orders, and the extended_hours=True option was used when placing the orders.

Other similar orders did execute. Shouldn’t all these executions be guaranteed?

ticker limit_price submitted_at (UTC) bar_timestamp (UTC) open high low close trades volume volume_weighted_price
WISA 2.11 2023-03-20 19:52:01 2023-03-20T19:52 2.14 2.14 2.085 2.1201 15 4355 2.125176
ALLR 0.1674 2023-03-20 16:24:00 2023-03-20T16:24 0.1666 0.175 0.1666 0.1713 252 330983 0.170373
LYLT 0.2144 2023-03-20 15:23:01 2023-03-20T15:23 0.215399 0.2195 0.2135 0.218 555 473157 0.217085
ASPU 0.1236 2023-03-20 14:50:01 2023-03-20T14:50 0.1241 0.13 0.12355 0.125699 115 96293 0.126128
ALLR 0.1357 2023-03-20 13:57:01 2023-03-20T13:57 0.135 0.14 0.135 0.139899 167 146248 0.136502
CDAK 0.4064 2023-03-20 13:33:01 2023-03-20T13:33 0.4 0.4252 0.4 0.4252 5 2761 0.411903
IRNT 0.3269 2023-03-20 13:33:01 2023-03-20T13:33 0.3286 0.34 0.3252 0.3253 44 65331 0.329762
CDAK 0.3953 2023-03-20 13:31:01 2023-03-20T13:31 0.3933 0.4397 0.3933 0.4378 9 2278 0.417783
NYCB 7.69 2023-03-20 13:07:01 2023-03-20T13:07 8.42 9.1085 7.0015 8.46 178 18084 8.488015
WAL 30.82 2023-03-20 13:07:00 2023-03-20T13:07 30.6685 35.2 29.6015 34.7 367 27211 34.334812
PACW 9.12 2023-03-20 13:06:01 2023-03-20T13:06 9.0985 10.96 9.0985 10.0585 406 19486 10.341609
PACW 9.61 2023-03-20 12:28:00 2023-03-20T12:28 9.56 11.27 9.28 11.16 444 59696 11.092691
DPST 7.47 2023-03-20 12:02:00 2023-03-20T12:02 7.95 7.99 7.43 7.99 392 53896 7.886161
LYLT 0.1368 2023-03-20 11:03:00 2023-03-20T11:03 0.1377 0.1438 0.136 0.1438 101 54400 0.140099 The reason none of these orders filled was because your limit buy price was in all cases lower than the ask price. Basically, there were no sellers wanting to sell to you at your limit price.

Buy orders in paper trading fill at the latest ask price. Sell orders fill at the latest bid price. This is pretty much the way orders will fill in live trading though, every so often, one will see a bit of price improvement.

I’ll use the first order in your list as an example. Below are all the NBBO quotes between the time the order was placed at 19:52 and then cancelled at 19:53 (the arrows indicate when the order was submitted and then cancelled). The order was to buy WISA with a limit of 2.11. That means the most you were willing pay was 2.11. However, during that time the lowest ask (ie the lowest a seller was willing to sell at) was 2.13. There were no sellers wanting to sell to you at your limit price which is why the order didn’t fill. A similar situation occurred with all the other orders.

In order for a buy limit order to fill, the limit price must be at, or higher, than the current ask price. Similarly, in order for a sell limit order to fill, the limit price must be lower than the current bid.

If one submits a limit order better than the current quote (ie a buy limit greater than the ask or a sell limit less than the bid) those are called “marketable limit orders” and are treated like a market order but with the benefit of a limit. Marketable limit orders will generally fill better than the limit at the current quote (similar to a market order). Regular “non marketable limit orders” will generally fill at the limit price.

The ONLY indicator if an order will fill or not is the current quote. The high and low prices are simply how some other trade executed . Count on your trades executing at the bid or the ask price.

Again consider the first order. The low was 2.085. Below are all the trades which occurred during the minute which the order was open. The highlighted order third from the top was that low for the minute. Compare that to the current quote at the time. The current quote was 2.14 ask / 2.08 bid. That order was probably a sell order (not a buy). It filled with a small $.005 price improvement from the bid. Since you were buying you won’t get that bid price.

In extended hours trading, there are not the same execution rules as during market hours. Orders can fill at any price regardless of current quotes (technically there are not even NBBO quotes). While during market hours there is a chance an order will not fill, during extended hours there is a much greater chance that an order won’t fill even if other similar orders are filling. An order can sit on one execution venue and never execute while similar orders execute on other venues. This is because, during extended hour trading, the venues aren’t ‘linked’ the way they are during market hours.

Does that make sense and answer your question?

Thanks @Dan_Whitnable_Alpaca for your response and for any help with the following related questions:

Would it be the case that, in Alpaca live trading, the same limit orders submitted through Alpaca would become the new NBBO bid price reflected in public quotes when my buy limit price is higher than the NBBO bid, even if the orders are not marketable upon submission? Would this happen as soon as the order is in the accepted state? For this to be the case, does the order need to have a quantity that is a round lot of multiples of 100 shares, or will the NBBO bid be taken by automatically rounding the order quantity down to the nearest round lot? Any other requirements? If one submits a buy limit order then you are essentially ‘bidding’ and the limit price is your ‘bid’. Consider the three scenarios

  • limit price below current NBBO bid: your order isn’t the ‘best’ bid. by definition it is below the current ask price so the order will not fill. it will be queued.
  • limit price above NBBO bid / below NBBO ask: your order may become the current NBBO. since it is below the current ask it will typically not fill. it will be queued.
  • limit price above NBBO bid / above NBBO ask: your order will fill immediately and typically at the current ask.

For an order to become a NBBO quote it must 1) be a round lot order and 2) must be ‘displayed’ by the execution partner/venue. Traders are not always required to ‘display’ their orders and therefore become an NBBO quote. Often one doesn’t want to broadcast to the world what price they are willing to buy at. This is especially true for very large orders. For smaller orders it is also typically in one’s favor to be a little better than the NBBO.

As a general rule, Alpaca’s trading partners (eg Citadel and Jane Street) will not display their orders, so generally Alpaca client orders do not show up as a NBBO quote.