webull icon indicating copy to clipboard operation
webull copied to clipboard

Getting full info about option orders

Open nothingbutbacon opened this issue 3 years ago • 3 comments

Using the on_order_message callback, I could get the symbol/tickerID of the options order I placed, but unfortunately it doesn't give more details about the expiration date or strike price of the order, rightly so, as Webull doesn't send that information.

Is there a way I could use the orderId or anything from the response to get additional info about the order? The closest thing I could find is to use get_activities() function and look at the description field of the first item to get the info of the most recent options order I placed. For example:

orders = webull.get_activities()
print(orders['items'][0]['description'])

Is there a better way to get this information reliably (associate the info with the order id, for instance)?

nothingbutbacon avatar May 14 '21 19:05 nothingbutbacon

Just figured out that get_activities() doesn't work if I call it immediately after a order is filled. It takes a while to update (didn't measure but even after 10 seconds of an order fill, it still had old data)

nothingbutbacon avatar May 14 '21 23:05 nothingbutbacon

@tedchou12 is there any other way to reliably get this information or is this feature/api that needs to be added?

nothingbutbacon avatar May 18 '21 17:05 nothingbutbacon

I could get the symbol/tickerID of the options order I placed Do you mean the tickerID of the options or the underlying security? If it's the ticker of the option contract you have everything you need because those IDs are formulaic; they contain the underlying symbol, the expiration date, Put/Call direction, and strike price.

Otherwise, paste in this thread the response data you're working with

zenhorace avatar Nov 05 '21 05:11 zenhorace