Open gblankford opened 2 years ago
Do you mean how to cancel a quote? I'm not sure I'm following your question.
Not quite. Say you put in an order to buy 5 calls at $3000 strike for AAPL with limit price $10. If none of your order is filled, how would you cancel this order using the API?
I don't see any method for doing that. I would think that would be listed under the trading_account
model, but I don't see any reference other than executing an order. From a quick look, below is a good starting point. Please note that this has not been tested, but is a good starting point.
url="https://api.tastyworks.com/accounts/{}/orders/{}".format(
account_number,
order_number
)
requests.delete(url, headers=session.get_request_headers())
Edit: When I say this hasn't been tested, I mean strictly in Python it hasn't been tested.
Has anyone figured out how to cancel an unfilled or partially filled order? I may be missing it here, but would love assistance in figuring that out.