Order State Transitions

ksv
ksv edited February 2019 in Java client
Hi ,

I would like to understand the order state transitions.

When I place a buy order, I get below notification (Am only concerned about order state)

Initial State OPEN -> COMPLETE

When I place a stop loss sell order(SL-M)
Initial State OPEN -> TRIGGER PENDING

When I modify the above SL-M (changed the quantity to +20)

I get UPDATE notification? But actual order status is still TRIGGER PENDING and I dont get notification with TRIGGER PENDING after this.

Is this behaviour correct?
Tagged:
  • sujith
    Hi @ksv,
    Once you place an order, it goes through various states at the OMS. You can check a typical order's history here.

    UPDATE status in the notification is an interim status which means there is an update to the order. It can be a partial fill or order modification or state change like the above case (SL-M).
    To know the actual status of an order you need to pull orderbook.
  • ksv
    Thanks Sujith.

    I have one more small question.

    Can we always rely on onorderupdate notification? Is there any chance that we do not end up getting these notifications?

    After placing the buy order, I would like to know if the order is complete.
    After placing SL-M I want to know if the order is placed properly.
    After modifying the SL-M order, i want to be sure that its updated.

    I want to prevent the getOrderHistory API call to get the exact state if I can get all the information as part of postbacks/notification.

    If its not reliable, then I would like to use the getOrderHistory API.

    Can you please advise on the best practice ?

    Thanks again!

  • sujith
    We do send notifications whenever there is an update for an order.
    You won't get a notification for an open order. You need to fetch order history after placing an order. If there is an update to the order after that you will receive the notification.
    You can rely on order updates via websocket.
    You can check out documentation here.
Sign In or Register to comment.