Paper Trading Fill Time vs. Live Account

Hi. I’m new to Alpaca and I’m developing a relatively high speed algorithm for scalping early morning price action. My algorithm runs on the 5 second chart. I’ve integrated it with the paper API and get the following feedback from some of the orders I’ve placed:

{‘code’: 40310000, ‘message’: ‘cannot open a short sell while a long buy order is open’}

I placed the buy order at timestamp: 9:31:55.312, the sell order was rejected at 09:32:15.279.

What is the timeline I can expect for orders to fill? My orders were limit orders placed well above/below the current market price in an attempt to get a quick fill on both the buy and sell side. Is the timeline for order fulfillment the same for both paper and live trading accounts?

Thanks for any insight you can provide.

2 Likes

Hey @BinaryCat - Mallory from the Alpaca team here.

Looks like you’re going to want to make use of Bracket Orders, which are defined in this doc: Understand Orders - Documentation | Alpaca

Without a bracket order, you would not be able to submit both entry and exit orders simultaneously since Alpaca’s system only accepts exit orders for existing positions. Additionally, even if you had an open position, you would not be able to submit two conditional closing orders since Alpaca’s system would view one of the two orders as exceeding the available position quantity. Bracket orders address both of these issues, as Alpaca’s system recognizes the entry and exit orders as a group and queues them for execution appropriately.

Let me know if that makes sense, or if you need more clarification there!

1 Like

I don’t think this is the issue. My program operates on a 5 second chart. I changed the order type to market and this morning ran it on another asset. It placed a market buy order at 9:30:11.834 and the order didn’t fill until after 09:30:31.461. That’s over 20 seconds delay. Is this expected on non-paper accounts. What is the average fill time delay for an order?

Thanks.

2 Likes

Ok. So here’s a real issue. I’m testing a new algorithm on the minute timescale. I place an order at 09:04 this morning. Subsequently I attempt to sell the position at 09:06. Problem is, that the Alpaca system appears to show the existing buy order as pending and won’t let me sell it since it’s not showing as filled. Eventually it goes through and shows that the fill time was 09:04 which is consistent with when I sent the order. Why is there such a huge lag time between acceptance of the order and showing that it’s filled? I really want to use Alpaca because of the ease of integration with tradingview webhooks, but if this issue can’t be resolved I’m going to have to find another broker. Please let me know if this is an issue that is expected for real accounts and not just paper trading. Is there something that can be done on Alpaca’s side to speed up how fast the system shows that an order is filled?

Thanks!

1 Like

Hi there,

We are currently investigating and working on a known issue that results in a slowdown/delays on the Paper API side. We expect to be able to post an update in the next few days so the community knows what’s happening and when they can expect a fix to be deployed.

1 Like

Their paper platform doesn’t work well…sometime doesn’t work at all. It doesn’t seem to be reflective of the live platform. But it does scare off potential clients who are evaluating Alpaca as their primary broker.

It is not your code, it is on their side. It’s something wrong with the order update message getting sent out through the API.

1 Like

Hey @Brian67 - we are aware of an issue on the Paper Trading side that causes some issues with speed, and are actively investigating and working on a solution. Thanks!

1 Like

That was precisely why I was asking this question. I was worried that the paper API had similar performance to the live brokerage. In your experience, when you place a buy or sell order does it fill pretty much immediately? Does your account show a status of filled pretty much immediately? I really want to take my algorithms live, but won’t risk something like I saw this morning where I lost $200 on the paper account due to the latency issue. Which was about 5 minutes in this case…

1 Like

My experience is that when the paper system is broken, the live system is working fine. Immediately fill and update. But they do have issues with the Live system from time to time. Nothing as bad as the paper though. It still needs to be monitored. At least they are looking into it, so maybe next week it will be fixed. It seems to be based on market activity, so my guess is the throughput rate is too small for what it’s trying to handle.

1 Like

Hi, I am having a similar issue in my paper account even though my algo is not that quick. I do 1 trade per minute at most after the real time data arrives. Every time data arrives I check my account using /v2/account and determine if it is eligible to trade. The problem I am facing is that – When the algo finds it eligible to trade and trades. The next minute when the data arrives it again checks the account but the account doesn’t seem to be updated regarding cash, long_market_value, short_market_value and similar fields. So the algo will find it is eligible to trade again even though it is not. So algo takes the same trade. This is making algo lose the money.

1 Like