Alpaca API throwing Incorrect error message when order placed is far below available DT buying power

As per Alpaca API , the DT buying power available is 3006.92

Cash : 19747.75 Portfolio : 93681.23 Buy Power : 39495.50 DT Buy Power : 3006.92 Trades : 420 Market Value : 73933.48

Order being placed is worth 1095.0

Alpaca is throwing error :

Status Code: 403, Status Message: “Forbidden”, API Response Code: 40310000, API Response Message: “insufficient day trading buying power”

HOW in any WORLD , would the DT buying power of 3K will be insufficient for a mkt buy order of 1K

ALPACA is full of bugs !


@Andy_S I can check the logs and get a bit more information. What is the account number you were trying to place the order in and, ideally the symbol you were trying to buy.

Hi Dan,

The account nbr is PA38AARO39AM and it was RIVN symbol. Please let me know what was wrong with it.


Hi Dan,
were you able to check what happened to this account during the day time. Now i see that DT buy power is equal to Buying power, which was not the case during the middle of the day on Friday. I did not do anything on this account, i left it as it was on friday for you to look into it. Do you know why it was complaining regarding insufficient DT buying power during Friday ? On Friday mid day, it starting throwing exception that DT buying power was insufficient, when i checked it was around 3k and order that was rejected was around 1k, so I am still confused why it would complain and why DT buying power was 3k on Friday, and how it came back to 79k today on Sunday?
I need to know this as if affect my trading decision during the day. What buying power should we be checking before placing an order? Please let me know.

thanks, Andy

@Andy_S The first question you asked was “HOW in any WORLD , would the DT buying power of 3K will be insufficient for a mkt buy order of 1K”. The answer is that the stock you were attempting to buy (RIVN) has a margin requirement of 100%. The daytrading buying power reported in the API is the amount you have to open ‘regular’ securities with 30% margin requirement which is 4x excess equity. However, since RIVN has 100% margin requirement it is essentially not marginable so one needs to divide the DTBP by 4. Therefore, the buying power to buy RIVN is 3006.92 / 4 or 751.73. You were attempting to buy $1095.00 which exceeded that buying power so the order was rejected.

Alpaca is looking at ways to improve the buying power reporting to account for securities with higher margin requirements, but for now one must account for those manually. Look at the assets table. If maintenance_margin_requirement is not 30, then to be safe, divide the DTBP by 4 to get the buying power available for that specific symbol.

This you Dan ! This helps a lot to put this check in place before placing the order. Appreciate it .

thank you,