Hi, I tried submitting a trade today via the API to my paper account and I received this error:
401 Client Error: Unauthorized for url: https://paper-api.alpaca.markets/v2/orders
I have been designated a PDT in my paper account (and rightly so) but I have 99k in equity there so I shouldn’t be limited. I have the config for the day trading set to “Block on entry” but I think that shouldn’t apply, it just applies to when the rule is checked (if my understanding is correct).
I also regenned my API keys just in case that was the issue.
Edit: I should have included my code, here is what I’m doing that’s getting blocked:
market_order_data = MarketOrderRequest(
symbol='SPY',
notional=100,
side=OrderSide.BUY,
time_in_force=TimeInForce.DAY
)
And I tried:
market_order_data = MarketOrderRequest(
symbol='SPY',
qty=1,
side=OrderSide.BUY,
time_in_force=TimeInForce.DAY
)
But then I tried in the account GUI and it worked fine so I know it isn’t a block…