It is my understanding that one cannot switch from Short to Long or Long to Short positions without first closing the initial position, make sure the order is filled the order the new position otherwise you get the Insufficient Quantity Avaialble Error. To move from Short to Long in Paper Environment. I:
- Place a Buy Order
- Wait 5 seconds and check for any open orders (check_orders = api.list_orders(status=‘open’))
- If check_orders, then don’t place the second Buy order
- Else, place the Buy order to enter long position
Sometimes, when the Else statement runs, it still fails with Insufficient Quantity Available
Alpaca Support - Why does my order say "insufficient quantity available"?
Can anyone help me with this why it still happens even though there check_orders returns no value?