Recently Seeing Partial Fills on Market OPG order (S&P500 stocks)

Starting about three weeks ago on, I believe on Monday, February 26, I started seeing partial fills on small orders ($2500 position size) with paper trading exclusively using S&P500 stocks and exclusively market OPG (aka MOO) orders. For two days there were problems, then suddenly everything was fine. 100% full order fills. For about a week and a half. Then, again starting on a Monday morning, I believe March 11, the issue came back. I’m seeing partial fills more than 30% of the time with both new long and short positions. This morning, there were four out of six new long positions that were filled partially (67%). Specifically I saw the following partial fills:
GOOGL: 0 out of 16 shares filled, avg daily volume of 24.6M shares
RMD: 11 out of 12 shares filled, avg daily volume of 945k shares
MRK: 14 out of 20 shares filled, avg daily volume of 8.4M shares
TDG: 1 out of 2 shares filled, avg daily volume of 215k shares

JWN and M both filled 100%, 128 and 117 shares respectively.

Now this is blatantly ridiculous in practice. Market OPG (aka MOO) orders make it into a morning auction and are matched up with all orders by the exchange such that the open price is set to fill the most orders. But this has been discussed before and I understand how Alpaca paper trading “works” since paper orders obviously never make it into an opening auction. But this never affected trades going through before, all orders filled 100% of the time for many months. The price was off because of the way that the paper trading logic works market OPG orders but that’s ok.

Now I’m working to troubleshoot why my profit taking order entry bot isn’t properly handling partially filled orders (show up as “canceled” not “filled”). This is something that I knew I might face once my investor real money accounts grew such that my MOO entry orders were above ~$250k in position size for lower daily volume S&P500 stocks. It’s not something that I expected to have to troubleshoot with partial fills on tiny trades on paper accounts. So this is slowing my development down. And, btw, with the various market mechanisms, specialists, market makers, etc., our expectation is that as our position size increased above $250k on small volume S&P500 stocks, that we still wouldn’t get partial fills on market OPG orders, we’d just get less beneficial pricing on our fills as we’d be pushing the opening price with our orders. The market mechanisms would supply the requested shares just at ever increasing (long positions) or decreasing (short positions) prices.

It seems obvious that some work has been done recently to the paper trading software such that Alpaca is putting some kind of constraint logic on the trade size for paper trades. Also obviously this logic doesn’t work since I’m getting 67% partial fills on $2500 orders using S&P500 stocks. But guys, what Alpaca has set up now is blatantly ridiculous in practice. Why you’re bothering to waste programmer time putting volume constraints on paper orders is beyond me. If you’re worried about some nefarious individual trying to spoof paper profits by trading 1B share increments of MSFT stock for $0.01 gains each day, any investor with an IQ above that of plankton should easily spot those kinds of shenanigans. And there are a lot better ways to program in those kinds of volume gaming defenses without interfering with low volume trades that wouldn’t cause a ripple in the market with real money trades.

So, I’ll get my profit / bailout order bot’s programming improved so this doesn’t impact my testing. But it has cost me weeks of forward progress.

@DavidC While the paper trading environment simulates live trading pretty well, there are a few things which simply aren’t implemented. One thing is OPG and CLS orders. These are simply treated like all other orders. So, 1) they will get random partial fills like other orders and moreover 2) they fill at the current quote like other orders. They do not fill at the open or close price as one would see in actual live trading.

Seriously? I can tell it’s not rain…

Aka, why did I not see a single partial fill for many, many months and now I’m averaging ~30% partial fills per day and often more than 50%? On tiny orders?

There was obviously a change made in the software.

Thankfully it looks like my programmer found a way around this issue such that our profit / bail out orders will now successfully occur when there’s a partial fill and the market OPG entry order shows as “canceled” instead of “filled”.

I am having the same issue as of today,
Obviously we all know that paper trading is simulated environnement and that OPG orders are turned into market orders but that doesnt explain why there is 0% partial fill on most days and above 50% partial fills on some days like today.

@Joffrey The paper trade simulation algorithm simply uses a random number to 1) decide if the order will fill complete or not and 2) decide the percent fill if it’s a partial fill. If it’s a partial fill, the remainder of the order get’s put back into the ‘orders’ queue and the fill process repeats. There shouldn’t be any reason to see much change to the fill rate from day to day other than random variation.

As a test, I ran a query of the partial fills as a percent all submitted orders over the past 3 days. The numbers are about the same. 24% vs 25%.

Order Status Todays Count Pct 3Day Count Pct
new 477,526 1,972,067
partially_filled 113,907 23.8% 502,281 25.5%

Okay sorry, the issue isnt just partial fills, the issues is that most of my OPG orders (submitted within the rules) are getting canceled After a partial fill.

And this juste starting happening Yesterday After working properly for 2 weeks.

I juste want réassurance that this isn’t something I have to expect when I will be using Real money

@Joffrey What you experienced with a high percentage of partial_fills and orders being cancelled wasn’t your algo. It should look much better today?

First, I want to add a detail about OPG orders in paper. They are simulated exactly like market orders submitted at open except they are cancelled 30 seconds after the open (to simulate a single fill at an opening auction). Typically, an order will fill complete within 30 seconds and everything looks ok. There can be times however, when systems slow down for various reasons, that orders take longer to process and therefore these OPG orders get cancelled or ‘cut off’ after 30 seconds. That appears to be the case on Tuesday May 28. Not certain of the cause, but maybe has to do with the holiday on Monday?

In any case, this is a manifestation of simulated paper trading and typically won’t occur in live trading. In live trading there can be a chance that an OPG order won’t fill or will get a partial_fill but that is rare. It happens in the case of an order imbalance where the quantity of buys and sells doesn’t match (so the difference goes unfilled).

I ran a sample of OPG market orders over the past 7 days. The table below shows the total orders and a percent of those which were canceled before they filled complete (all had at least one partial_fill). Notice Tuesday’s percent jumped to almost 60% (which aligns with the 50% experienced above). Normally the expectation should be about 1%.

Thank you for pointing this out!

Submitted At Total Filled Complete Canceled Pct Cancelled
Mon, May 20, 2024 978 888 90 9.2%
Tue, May 21, 2024 985 976 9 0.9%
Wed, May 22, 2024 1168 1,125 43 3.7%
Thu, May 23, 2024 1132 1,121 11 1.0%
Fri, May 24, 2024 994 991 3 0.3%
Tue, May 28, 2024 822 331 491 59.7%
Wed, May 29, 2024 1042 1,038 4 0.4%

Thanks you for your response,
As you said, everything went fine today and I understand better now