Order Related queries

babansfolio
Hello Zerodha Support team / @sujith

I have following queries regarding order related, if possible please share your feedback.

Question:1

Suppose BUY/SELL Order triggered by following conditions,

place_order(variety='regular', exchange='NFO', tradingsymbol='NIFTY18FEBFUT',
transaction_type='BUY', quantity='75', product='NRML', order_type='MARKET', disclosed_quantity=None, trigger_price=None, squareoff=None, stoploss=None, trailing_stoploss=None, tag=None)

Now to Square off existing position, do we need to trigger just opposite order conditions like,

place_order(variety='regular', exchange='NFO', tradingsymbol='NIFTY18FEBFUT',
transaction_type='SELL', quantity='75', product='NRML', order_type='MARKET', disclosed_quantity=None, trigger_price=None, squareoff=None, stoploss=None, trailing_stoploss=None, tag=None)

Are there any other methods available to square off / clear current position?

Question:2

Is there any other more efficient way available to get order status, I am using the following method,

order_id = kite.place_order(variety='regular', exchange='NSE', tradingsymbol='INFY',
transaction_type='BUY', quantity='1', product='MIS', order_type='MARKET',
disclosed_quantity=None, trigger_price=None, squareoff=None, stoploss=None, trailing_stoploss=None, tag='ATRS1234')

order_list = kite.order_history(order_id=order_id)

Question:3

Why there are multiple order status generated against each triggered orders, like

----------------------------------------------------------------------------------------------------------------------------------------
'order_id': '180417001159849', 'exchange_order_id': None, 'parent_order_id': None, 'status': 'PUT ORDER REQ RECEIVED',

order_id': '18041700time(2018, 4, 17, 12, 49, 46), 'exchange_update_timestamp': None, 'exchange_timestamp': None, 'variety': 'regular', 'exchange': 'NSE', 'tradingsymbol'
d_quantity': 0, 'price': 0, 'trigger_price': 0, 'average_price': 0, 'filled_quantity': 0, 'pending_quantity': 1, 'cancelled_quantity': 0, 'market_prot
order_id': None, 'status': 'OPEN PENDING'

------------------------------------------------------------------------------------------------------------------------------------------
'order_id': '180417001159849', 'exchange_order_id': '1100000003707721', 'parent_order_id': None, 'status': 'OPEN', 's
.datetime(2018, 4, 17, 12, 49, 46), 'variety': 'regular', 'exchange': 'NSE', 'tradingsymbol': 'INFY', 'instrument_token': 408065, 'order_type': 'MARKE
rice': 0, 'filled_quantity': 0, 'pending_quantity': 1, 'cancelled_quantity': 0, 'market_protection': 0, 'tag': 'ATRS1234', 'guid': 'Lf3kWEGbA3jVnp5E'}
us_message': None, 'order_timestamp': datetime.datetime(2018, 4, 17, 12, 49, 46), 'exchange_update_timestamp': None, 'exchange_timestamp': datetime.da
'transaction_type': 'BUY', 'validity': 'DAY', 'product': 'MIS', 'quantity': 1, 'disclosed_quantity': 0, 'price': 0, 'trigger_price': 0, 'average_pric
'}]
-------------------------------------------------------------------------------------------------------------------------------------------

Questiion:4

How to know order price of Market orders?
  • sujith
    sujith edited April 2018
    @babansfolio,
    1. You need to place a market order with opposite transaction type to square off regular orders. To exit bo or co position you can use exit order method.
    2. Order history API will give the different statuses of an order in the system from the time it is placed. You can always find the latest status at the end of the list. You can go through more details in the documentation.
    3. You can go through documentation here to know more about the order flow.
    4. You can use the field average_price in the order response.
Sign In or Register to comment.