webull icon indicating copy to clipboard operation
webull copied to clipboard

cancel_order for Options

Open pankajai opened this issue 2 years ago • 7 comments

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

pankajai avatar May 19 '23 03:05 pankajai

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.

DouGrimaldi avatar May 21 '23 23:05 DouGrimaldi

Where are you pulling 713120601031575552 and 82JSC93IK3RQ16PC6MMCUEM929 from exactly?

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

Adidez avatar May 22 '23 17:05 Adidez

-- 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')

pankajai avatar May 22 '23 19:05 pankajai

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

Adidez avatar May 22 '23 23:05 Adidez

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

Adidez avatar May 22 '23 23:05 Adidez

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.

DouGrimaldi avatar May 23 '23 02:05 DouGrimaldi

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: @.***>

Adidez avatar May 23 '23 08:05 Adidez