Cancel order
-
Hi @admin team and Traders,
When I tried to cancel my order, it always complained that cancelOrder() missing 1 required positional argument: 'variety'.
Below is my order parameters. and it was submitted successfully.
{'variety': 'NORMAL', 'tradingsymbol': 'IDEA-EQ', 'symboltoken': '14366', 'transactiontype': 'BUY', 'exchange': 'NSE', 'ordertype': 'LIMIT', 'producttype': 'INTRADAY', 'duration': 'DAY', 'price': '11', 'squareoff': '0', 'stoploss': '280', 'quantity': '1'}
Below is my order cancel parameters.
{'variety': 'NORMAL', 'orderid': '210129001533859'} resp = trading_object.cancelOrder(order_cancel_params) --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-54-3e106dd6b2ae> in <module> ----> 1 resp = trading_object.cancelOrder(order_cancel_params) TypeError: cancelOrder() missing 1 required positional argument: 'variety'
I wonder if im doing something wrong. Thanks for your time and effort.
-
I am still facing the same issue, how to solve ?
-
Thanks. Understood. I should have checked the code first. Sorry.
-
HI @rajanprabu
You are passing the parameters in a key-value pair which is considered as a single parameter in the function, whereas the function takes 2 parameters i.e. orderid and variety individually.
For example, cancelOrder(orderid,variety)