track realtime trade status

rajukumarpu9
Can you please guide me on the following point.

1. How to track placed order in real time. Like when it get executed and quantity, it's fully executed or partial and what is trigger price.

2. modify, cancel or place another SL order once the order get executed in real time.

Please provide sample code snippet in python
  • rishiswethan
    rishiswethan edited June 2019
    https://pastebin.com/t9ZGSjBt

    print(check_order_placement([266561856195, 8546416416341561]))
  • rishiswethan
    rishiswethan edited June 2019
    Above function will take in an array of order ids and return which orders are successful and which ones failed as a dict

    {orderid1>: True/False, orderid2, ............}

    Enjoy!
  • rajukumarpu9
    thanks for the info. Please also let me know how can I track open, close, high, etc of particular ticker in real time.
  • rishiswethan
    The devs recommend websockets, I don't use this, but, you can do more research on this

    To get simple ohlc info, you can use kite.quote([stock1:exchange_name, stock2_exchange_name...])
  • rajukumarpu9
    thanks, how can I get 3 mins ,5 mins, 15 mins .. candle high, low, close etc of a sticker in real-time. I think kite.quote only give us live streaming data in fraction of second.
  • rajukumarpu9
    suppose I have placed a bulk order let's say 10000, 20000. then execution of order take some time to get it fully executed. kite.orders() gives us the live order status.
    for example : -
    I placed an order
    scrip_name = SBIN
    position =20000

    got an order id =12242424442
    assumption this order is not fully executed @ the time of calling kite.orders()

    Now, I call kite.orders(), what shall I get, how to track that my order is fully executed or not .
    shall I get sub_order_ids for my order_id which is not completely executed in kite.order() return.

  • rishiswethan
    rishiswethan edited June 2019
    You'll know what to do by simply running this command

    print(kite.orders())

    or

    for order in kite.orders():
    print(order)

    You'll be able to see all the details that you see in the kite website, including the number of stocks left from your order, etc
Sign In or Register to comment.