Accurate OPG and CLS prices for Paper trading

It would be very helpful if the paper trade order prices accurately reflected the market for OPG (Market On Open, MOO) and CLS (Market On Close, MOC) orders. Right now it looks as if the OPG and CLS orders are grabbing some price near the open or close rather than the actual open or close price and this can often vary significantly. For example, one of my paper trades this morning was to short VIAC at the open. The market open was $36.81 but the paper trade had the trade open price with a short at $36.70 or 0.3% lower than it would have been in the real world.

I would think that it would be very easy from a programming perspective to use the actual market opening and closing prices for OPG and CLS orders with paper trading. Unless an OPG or CLS trade was large enough in size to affect the initial price auction (say, more than ~2% of the average daily volume), you can pretty much guarantee that, in the real world, an OPG or CLS order would be filled at a stock’s Open or Closing price.

Now, I’m not saying that the paper trade should look at the trade’s volume compared to the average volume; let the programmer understand that. But, anyone with a reasonable number of shares for a trade should get the Open and Closing price with OPG or CLS orders and this would be very easy to code into the paper trading engine.

Thanks!

I cannot say for certain if the Alpaca API is returning the correct opening auction price. However you should note that there is a difference between the first print on the NMS tape and the opening auction print at the primary exchange.

For example, looking at VIAC on Yahoo Finance for Dec 29th, 2020, it shows the first NMS price at $36.81. However there’s no guarantee that the market maker on the Nasdaq opened at exactly that price in their opening auction. In fact, looking at the opening 1-minute high/low bar, it seems like there was a lot of selling pressure. It’s likely that there was an order imbalance during the Nasdaq opening auction which meant the market maker would have printed the opening lower to allow for all the buying they had to do.

Short answer: Never assume the opening price from NMS will be the price you get on an MOO/LOO order. You’ll get close on Nasdaq. But if it’s a NYSE/AMEX listed name, you could easily see a price deviation of 2%.