[Bug]: TradingStream not sending status update for bracket orders
- Lingua principale
- Python
- Stelle
- 1.5k
- Fork
- 397
- Merge medio
- 1g 16h
- PR unite (30g)
- 6
Descrizione
### Is there an existing issue for this?
- [X] I have searched the existing issues
### Current Behavior
When trading long or short bracket orders with one stop loss (Stop Order) and one take profit (Limit Order), the TradingStream does not update the stop loss order status from "Held" to "Cancelled" when the take profit order is filled.
When the bracket order is initially sent via the trading client and before the take profit or stop loss prices are hit, the main long or short order has a "Filled" status, the stop loss has a "Held" status, and the take profit has a "New" status (all as expected). If the stop loss price is hit, the take profit order status changes to "Replaced" and the stop loss order status changes to "Filled". Both of these status updates are received from the TradingStream and thus everything works as expected. In the opposite scenario where the take profit price is hit, is where the issue arises. All looks as expected in Alpaca's trading interface and the stop loss order does show a status of "Cancelled" when the take profit price is hit but this is not reported via the TradingStream.
### Expected Behavior
When the take profit price is hit, the take profit order status updates to "Filled" and this status update is sent via TradingStream (as it currently does). The stop loss order then updates to "Cancelled" and this is also sent via TradingStream as another update (which it currently does not)
### SDK Version I encountered this issue in
0.6.1
### Steps To Reproduce
```markdown
1. Send bracket order via TradingClient
2. monitor updates from TradingStream
3. Observe how stop loss order does not receive a status update when the status changes to "Cancelled" upon filling take profit order.
```
### 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_
Guida per i contributori
Apri la guida per i contributori
Valutazione
Questa issue non è ancora stata valutata.