alpacahq / Alpaca-API

The Alpaca API is a developer interface for trading operations and market data reception through the Alpaca platform.
https://alpaca.markets/
144 stars 13 forks source link

Day Trading Power is 0 #112

Closed DataPools closed 4 years ago

DataPools commented 4 years ago

I am currently trading on a paper account and every time I try to execute a trade, I get an "insufficient daytrading buying power" error. However, my account still returns false for pattern day trader. My account multiplier appears to be 4.

My paper account has more than $25,000 cash in it so I don't understand why it is not letting me trade. Here is what my account returns:

{
"id":"[Redacted]",
"accountNumber":"[Redacted]",
"status":"ACTIVE",
"currency ":"USD",
"cash":112514,
"portfolioValue":112514,
"patternDayTrader":false,
"tradeSuspendedByUser":false,
"tradingBlocked":false,
"transfersBlocked":false,
"accountBlocked":false,
"createdAt":"2020-03-23T16:29:36.617623Z",
"shortingEnabled":true,
"longMarketValue":0,
"shortMarketValue":0,
"equity":112514,
"lastEquity":35848.85,
"multiplier":4,
"buyingPower":225028,
"initialMargin":0,
"maintenanceMargin":0,
"sma":0,
"daytradeCount":42,
"lastMaintenanceMargin":356647.455,
"daytradingBuyingPower":0,
"regtBuyingPower":225028
}
umitanuki commented 4 years ago

Day trading buying power is calculated as below, and it seems like you had overnight position whose maintenance margin requirement (lastMaintenanceMaign) exceeded the equity (lastEquity) so no day trading buying power was generated. See more details in:

https://alpaca.markets/docs/trading-on-alpaca/user-protections/#day-trade-margin-call-dtmc-protection-at-alpaca