Hi,
I was attempting to identify changes to Future’s positions using Websockets.
-
I am trying to record changes to the Position. To do this, should I only log changes that have a pa > 0 for the positions listed under “P”? For example, down below (in the record listing), there are 3 entries listed under “P”. Only one of them has a pa> 0 Why are these other 2 records (under “P”) listed even when they have amounts = 0? What is the purpose of the fields “cr”?
-
I am also trying to determine when the position is closed. What rules can I follow to make sure I do this correctly?
Any help, hints or advice on how to do this would be greatly appreciated.
{'E': 1609378092165, 'T': 1609378092162, 'a': {'B': [{'a': 'USDT', 'cw': '9982.90119401', 'wb': '9999.96580239'}], 'P': [{'cr': '43.59957000', <----- what does this mean 'ep': '0.00000', 'iw': '0', 'ma': 'USDT', 'mt': 'isolated', 'pa': '0', <--- why is this record listed in the results under "P" 'ps': 'BOTH', 's': 'BTCUSDT', 'up': '0'}, {'cr': '780.48126002', 'ep': '28498.01000', 'iw': '17.06460838', 'ma': 'USDT', 'mt': 'isolated', 'pa': '0.003', 'ps': 'LONG', 's': 'BTCUSDT', 'up': '0.10569000'}, {'cr': '-673.46186999', <---- what does this mean 'ep': '0.00000', 'iw': '0', 'ma': 'USDT', 'mt': 'isolated', 'pa': '0', <---- why is this record listed in the results under "P" 'ps': 'SHORT', 's': 'BTCUSDT', 'up': '0'}], 'm': 'ORDER'}, 'e': 'ACCOUNT_UPDATE'}