alpacahq / alpacahq/Alpaca-API

Buy Limit order misinterpreted as Sell order

Đang mở
#271 1 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Không có dữ liệu ngôn ngữ
Star
173
Fork
17
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

**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

Hướng dẫn đóng góp

Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này

Đánh giá

Issue này chưa được đánh giá.

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.