alpacahq / alpacahq/Alpaca-API

Buy Limit order misinterpreted as Sell order

未关闭
#271 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
没有语言数据
星标
173
派生
17
PR 合并指标
30 天内没有已合并 PR

描述

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

贡献指南

这个仓库没有索引到贡献指南

评估

这个 Issue 还没有评估数据。

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。