Navigation

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

    ROBO order not getting cancelled from API

    Python SDK
    0
    1
    18
    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
      sawantnitesh last edited by

      Not able to cancel ROBO order from SmartAPI.
      SmartConnect.cancelOrder method returns Success response but ROBO order is not getting cancelled in Angel Broking portal.
      Response of cancelOrder example : {'status': True, 'message': 'SUCCESS', 'errorcode': '', 'data': {'orderid': '231228000172901', 'uniqueorderid': '231228000172901'}}

      Following is code to cancel all open orders :

      def cancell_all_open_robo_orders(smartAPI):
          
      	#Cancel all open orders including ROBO orders
      	order_book = smartAPI.orderBook()
      	if order_book['data'] :
      		for order in order_book['data']:
      			if order['status'] == 'open' or order['status'] == 'trigger pending':
      				orderOutput = smartAPI.cancelOrder(order['orderid'], 'NORMAL')
      				print(orderOutput)
      				time.sleep(1)
      
      
      1 Reply Last reply Reply Quote 0
      • First post
        Last post