tedchou12 / webull

Unofficial APIs for Webull.
MIT License
596 stars 181 forks source link

cancel_order for Options #398

Open pankajai opened 1 year ago

pankajai commented 1 year ago

cancel_order is not working for cancelling an option order. Am I missing something here. I retrieved the Working order and then tried using both in canel order - 'orderId': 713120601031575552, 'comboId': '82JSC93IK3RQ16PC6MMCUEM929' - none helped.

I verified in Webull App - the order is still active.

--- CODE snippet --- for order in open_orders: print(order['orders'][0]['orderId'],"-",order['orders'][0]['statusCode']) print(wb.cancel_order('713120601031575552')) print(wb.cancel_order('82JSC93IK3RQ16PC6MMCUEM929'))

--- OUTPUT --- 713120601031575552 - Working False False

DouGrimaldi commented 1 year ago

bumping this, cancel order isn't working for me either and i've tried a lot to fix it. Same as you, it says it works but it doesn't.

Adidez commented 1 year ago

Where are you pulling 713120601031575552 and 82JSC93IK3RQ16PC6MMCUEM929 from exactly?

Also can I see your code for placing an option order as well

pankajai commented 1 year ago

-- Code to place the order, many of these are either derived or user input option_order = wb.place_order_option(optionId=vOpt_Id, lmtPrice=vOpt_LmtPr, action='BUY', orderType='LMT', enforce='GTC', quant=2)

-- I get those OrderId and ComboId from the Working orders output - open_orders = wb.get_history_orders('Working')

Adidez commented 1 year ago

I mean when you place the order. How are you pulling the optionId exactly? This is important in the final cancellation.

Adidez commented 1 year ago

If you have github I can just look at the entire class would be easier

DouGrimaldi commented 1 year ago

I mean when you place the order. How are you pulling the optionId exactly? This is important in the final cancellation.

can't speak for the other guy, but would it be possible for you to share an example of how to properly cancel the option order? Because on my end it says the order should be cancelled but when I check it isn't.

Adidez commented 1 year ago

He's cancelling it correctly. We need to see all the data points.

On Mon, May 22, 2023, 9:42 PM DouGrimaldi @.***> wrote:

I mean when you place the order. How are you pulling the optionId exactly? This is important in the final cancellation.

can't speak for the other guy, but would it be possible for you to share an example of how to properly cancel the option order? Because on my end it says the order should be cancelled but when I check it isn't.

— Reply to this email directly, view it on GitHub https://github.com/tedchou12/webull/issues/398#issuecomment-1558418249, or unsubscribe https://github.com/notifications/unsubscribe-auth/AATIQHYGJRCV7TYUTRY5FI3XHQPYZANCNFSM6AAAAAAYHH6KEA . You are receiving this because you commented.Message ID: @.***>