some of my overnight stock sell orders are getting rejected but the buy orders were accepted for the same tickers, these same orders would work totally fine during pre and after markets as the parameters are exactly the same - meaning I have no fractional orders, order execution will not cause a position to flip from long to short, correct Time in force, limit order only etc etc as I have checked with AI and ruled out all those possibilities. Can someone provide an explanation or look into this?
@ghostblade1982 I can help, but I need a bit more information to check the Alpaca logs.
- Were these orders in a paper or a live account?
- What was the approximate time, including timezone, at which you submitted your order request?
- What was the order for, including symbol and quantity?
With that information, I can check the logs, which often contain helpful troubleshooting information.
- Live account
- the time was around 8:02 PM EST, when the overnight session started
- the order was for FVRR, quantity 358
@ghostblade1982 That order was rejected because your limit price was too high. Specifically the reject reason was Invalid limit price 14.91. The price must be less than or equal to 12.60 (20% of 10.50)
Execution partners have different rules regarding how far limit prices can be from the current price/quote. This partner enforces a 20% limit while others have a 50% limit. A good rule of thumb however might be 10%. Note that this would apply to both buys and cells.
Thanks @Dan_Whitnable_Alpaca for investigating this issue.
- Is the error message returned in the place order response?
- Do you mean to say, Alpaca route different symbols to different partners during overnight hours? And how do users like me know what the limit will be for the ticker I’m trading?
@ghostblade1982 You asked a few questions…
Is the error message returned in the place order response?
No, the order simply gets rejected once it is routed to an execution venue. The API responded with a normal 200 status in this case, which simply means that the order was valid and accepted by Alpaca. Once an order is accepted, it is asynchronously routed to an execution venue. That venue typically executes the order and returns the filled status. In some cases, however, the venue can reject an order, in which case it returns a rejected status. You should periodically check the status of all your orders once they are submitted.
Do you mean to say, Alpaca route different symbols to different partners during overnight hours?
Alpaca primarily routes to different execution partners based on the types of orders the venue can execute. It’s typically not based upon symbol. For overnight orders, the only execution partner Alpaca currently uses is Blue Ocean Technologies (BOATS). They are one of the few execution venues open during overnight trading.
And how do users like me know what the limit will be for the ticker I’m trading?
There isn’t a good way to check specific limit price requirements. Partly because each venue is different, and one doesn’t know which venue an order will be routed to. Alpaca doesn’t even store this information. A good rule of thumb is to keep your limit prices within 5-10% of the current quote. For a sell order that is 10% above the current bid. For a buy order that is 10% below the current ask.
Can Alpaca return these error messages in the API response so it will be more user friendly? It would save you guys a lot of tickets as well. @Dan_Whitnable_Alpaca