Plain long market orders not executing - paper account

My algorithm submits a market buy order and then, 1 minute later, it cancels it if the order did not execute. In the vast majority of cases, the order does not execute. Why is that? Note that this is happening in the paper account, and I have not tried to live account.

See examples of submitted orders that my algorithm had to cancel one minute after submission in the table below. For the ones that I checked, the stock did trade during that minute.

I’ve had the same problem with limit orders, even though the stock traded for prices better than the order’s limit.

Symbol Qty Filled Qty Side Type Time in Force Limit Price Stop Price Filled Avg Price Notional Amount Status Fee Source Submitted at Filled at Canceled at Replaced at
JAN 520 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 14:48:00 2023-03-15 14:49:00
ESPR 628 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 14:44:00 2023-03-15 14:45:00
ESPR 869 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 13:59:00 2023-03-15 14:00:00
ESPR 342 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 13:45:00 2023-03-15 13:46:00
LPSN 142 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 13:32:00 2023-03-15 13:33:00
SIOX 2631 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 13:28:00 2023-03-15 13:29:00
PACW 87 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 13:13:00 2023-03-15 13:14:00
UVIX 45 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 13:11:00 2023-03-15 13:11:00
FRC 31 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 13:10:00 2023-03-15 13:11:00
PACW 87 0 buy market gtc - - - - $0.00 canceled 0.00 access_key 2023-03-15 13:10:00 2023-03-15 13:11:00

@jazs.pro Looking at a few of the orders you have listed it appears the times are in US Pacific Time. That is 3 hours behind Eastern, or market time. All your orders are being submitted after markets have closed at 16:00. That is why they are not executing immediately. If left open they will fill the following day when markets open at 9:30.

Ok, thanks, I realize now I had not set the extended_hours=True parameter in the request.