I want to be able to retrieve both legs of my OCO order.
If I pull list_orders I only get the ‘open’ orders, and basically 1/2 of the OCO order information. It seems you get the limit side and a limit_price. For legs it says None. Stop_price is also None.
If you query with status=“held”… it looks like the information might be in there, but it really seems to respond as “all”, which include all the closed, etc. but I don’t want them all… I want the ones that are not filled. Which are open or held. So I can see the value of both legs. The system knows because if I log into Alpaca I can see both orders with the limit_price and stop_loss.
The Python wrapper doesn’t appear to take symbols as a parameter:
</>
1 orders = api.list_orders(status=“held”, symbols=“MMYT”)
2 for order in orders:
3 print(order)
TypeError: list_orders() got an unexpected keyword argument ‘symbols’
</>
It can’t be that I’m supposed to get all order from all time and then drop all of the filled orders or search my symbol with not filled? That just doesn’t seem logical so there must be a better way?