Paper Trading market orders fill delay

Hi, so I am trying to test some of my strategies using paper trading on Alpaca. I also bought a subscription of Alpaca just so I could get live data. Today was my first run and I am trying to understand why market orders took so long to fill. I had 6 market orders in total, 3 were duplicated, but I couldn’t understand what happened here. It took almost 5 minutes to fill a market order and I feel like it is a little unusual for a volatile big ticker symbol like TSLA. They were sell orders though, but I still think since they are market orders, it definitely should not take more than a few seconds. If someone could tell me what I am doing wrong, it’d be really helpful. Thanks.

I had the same experience (simple orders taking MINUTES to fill) and ultimately gave up paper trading because the lag in order fulfillment made any data I got from paper trading simply un-useable. I have a margin account, so I just started ‘testing’ with $10 trades and it’s MUCH faster to fill.

I’ll also simply record the current price at the time my algo ‘flags’ to sell something and simulate it that way. It’s not as accurate, but it’s dang more accurate than something taking several minutes to fill that would otherwise fill in a couple milliseconds.

oh okay, that is weird. I was hoping to paper trade a little more, guess I will have to switch to this tactic. thanks a lot for repsonding :slight_smile:

Just keep in mind the difference between a margin account and a cash account.

Cash Account:

  • Doesn’t have a required balance.
  • You can only trade UP TO your cash available for the day. For example, if you have $1,000, you can ONLY make 2x $500 trades a day until the funds are settled at the end of the day.
  • Pattern Day Trading (PDT) rules apply. You’ll be flagged as a PDT trader if you make more than 3 trades in 5 days. If that happens, your account will be unable to trade and will be marked as “closing-only” for 90 days or until you change it into a margin account.

Margin Account:

  • Has basically none of the restrictions above BUT must have over $25,000 in the account at the end of each trading day.
  • There are rumors that the $25,000 is going to drop SIGNIFICANTLY very soon. I haven’t been following it super close, but the last I heard, they were dropping it to a $2,000 threshold and they are supposedly set to approve it sometime in the next couple weeks. If the $25,000 is killing you on the margin account, just keep practicing and wait for the updated threshold.

@kcducttaper You asked about fill times and paper trading, specifically for order 73fdac10-f09d-4f9f-b838-fd7c6c8a5a5d. In this case, the delay in filling was due to the number of partial fills. See below.

In paper trading, the simulator interjects random partial fills. It’s a small percentage, but much larger than one would see in live trading. This is intentional to provide algos with enough partial fills to ensure they respond correctly. However, the result is that fill times increase beyond what one would typically see in live trading.

To give you an idea, below are the execution times for a sample of paper orders last Thursday. These are the times when Alpaca first received the order and when it actually filled (the created_at and filled_at fields in the order record). Note the big spike on the far left. That is the ‘bucket’ from 0-9ms, and are orders that filled immediately without any partial fills. The rest of the graph shows the distribution as orders are randomly selected for ‘partial fills’.

Here are the times for the same time period last Thursday for live orders. Overall, the mean fill time is 195ms, but the median is only 7ms. The big spike on the left is again the 0-9ms bucket. Most orders fill in that time, similar to paper, but very few orders fill with partial fills, which is the main reason for the difference.

An interesting statistic is that the average fill price for the partially filled orders is about the same as if the order had filled immediately. On average, fill delay does not impact the average price. This of course, is an average, and some orders fill a bit better while others fill a bit worse. Overall, if one has a strategy that trades a reasonable number of orders, the results in paper trading will generally mimic those in live trading.

@Dan_Whitnable_Alpaca fair enough, can you provide me a link to where this is written in documentation? and if it’s not written in documentation, don’t you think it’d be helpful to write this so people can understand what is actually happening?