Navigation

    SmartAPI Forum
    • Register
    • Login
    • Search
    • Categories
    • Popular
    • Groups
    • FAQs
    • API Docs

    Cancel order

    Python SDK
    2
    4
    141
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • S
      Surya 1 last edited by

      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.

      A 1 Reply Last reply Reply Quote 0
      • A
        admin @Surya 1 last edited by

        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)

        S 1 Reply Last reply Reply Quote 0
        • S
          Surya 1 @admin last edited by

          @admin

          Thanks. Understood. I should have checked the code first. Sorry.

          1 Reply Last reply Reply Quote 0
          • S
            sunny887 last edited by

            I am still facing the same issue, how to solve ?

            1 Reply Last reply Reply Quote 0
            • First post
              Last post