Identify open orders and positions

Hello,

I’m working on a small app for my own fun and I was wondering if I can differentiate open orders and positions via the event-order-update websocket
I’m trying to identify 2 type of orders

  • OPEN ORDERS (without TP/SL)
    If we take a look at the link I’m trying to get a list with only ("ETHUSDT Limit at 4250) https://imgur.com/n5SVoRc

  • POSITIONS
    And another list with “ETHUSDT”, “LINKUSDT”, “RSRUSDT”, “BTTUSDT” https://imgur.com/kFDWZik

So far I couldn’t do it, I’ve find a couple of conditions for my open orders but it’s a bit wanky as this is for futures the open orders could be SELL or BUY

Thanks for any help :slight_smile:

Hi. Please keep track of the order side and status and you will be able to handle it.

First of all, you have to capture the events when the orders are created with status = NEW. They are the open orders. Then if the orders are canceled, rejected, or expired, remove them from the open order list or collections.

On the other hands, if the orders are FILLED, they are now the positions you hold or close. Do keep an eye on the order side and decide if it’s the increment or the decrement of the positions.

Yeah that’s what I was starting to do, thank you for your help :slight_smile: