alpacahq / alpacahq/alpaca-trade-api-js
[Bug]: Cannot open bracket order starting with sell stop
- Ngôn ngữ chính
- TypeScript
- Star
- 601
- Fork
- 155
- Merge trung bình
- 21 giờ 14 phút
- Pull request đã merge (30 ngày)
- 10
Mô tả
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Current Behavior
When I call the alpaca api with
```
{
symbol: 'SPY',
qty: 35,
side: 'sell',
type: 'stop',
order_class: 'bracket',
stop_price: 455.67,
time_in_force: 'day',
take_profit: { limit_price: 455 },
stop_loss: { stop_price: 455.96 }
}
```
It returned an error:
```
{ code: 42210000, message: 'bracket orders must be entry orders' }
```
### Expected Behavior
_No response_
### SDK Version I encountered this issue in
@alpacahq/alpaca-trade-api ^3.0.1
### Steps To Reproduce
```markdown
Call:
alpaca.createOrder({
symbol: 'SPY',
qty: 35,
side: 'sell',
type: 'stop',
order_class: 'bracket',
stop_price: 455.67,
time_in_force: 'day',
take_profit: { limit_price: 455 },
stop_loss: { stop_price: 455.96 }
})
```
```
### Filled out the Steps to Reproduce section?
- [X] I have entered valid steps to reproduce my issue or have attached a minimally reproducible case in code that shows my issue happening; and understand that without this my issue will be flagged as invalid and closed after 30 days.
### Anything else?
_No response_
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á.