alpacahq / alpacahq/Alpaca-API

Buy Limit order misinterpreted as Sell order

Aperta
#271 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Nessun dato sulla lingua
Stelle
173
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

**Describe the bug**
This morning I placed two market orders to buy two call contracts per order (POST on /v2/orders). The orders did not go through, both yielding status 403 “code”:40310000,“message”:“insufficient underlying qty available for covered call (required: 200, available: 0)”

It seems as though these orders were processed as sell orders instead of buy orders. The code was working properly before and I did not change it. I switched to paper trading and the issue was resolved. I switched back to live trading and the code worked properly again. With no changes made to the code.

What happened? It may have been a fluke but this is absolutely unacceptable. I lost out on money today because the API was not working properly. How do I make sure this never happens ever again?

**To Reproduce**
I was not able to reproduce the error (as I described above)

**Expected behavior**
A limit order is placed to BUY the contracts (not sell)

**Output**
Error entering position: failed to place order (status 403): {"available_qty":"0","code":40310000,"message":"insufficient underlying qty available for covered call (required: 200, available: 0)","required_qty":"200","symbol":"CLSK250110C00012000","underlying_asset_id":"8f33ee14-9d35-490c-b33f-6fbb2d163c13"}

Error entering position: failed to place order (status 403): {"available_qty":"0","code":40310000,"message":"insufficient underlying qty available for covered call (required: 200, available: 0)","required_qty":"200","symbol":"SBUX250110C00096000","underlying_asset_id":"0a7deac5-2d75-4e54-9f66-51c1c6fad55b"}

**Desktop:**
- OS: arch linux

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.