How to know the Position Ticket/Id in Hedge Mode

Hi,

I make robots for forex and I’m creating my first Binance robot in Hedge Mode and I have a question that seems simple but I couldn’t really find any answers in the documentation. I need to know the identifier of an open position, an id or ticket that gives me the exact position I want information from. Is this possible in the Binance Future API?

Thanks in advance for your help.

Hi.
You can query this endpoint to know your current open positions. https://binance-docs.github.io/apidocs/futures/en/#position-information-v2-user_data
It does not have a specific id field as identifier since it may result from multiple orders you created before. You may want to use a composite of several attributes (e.g. symbol and positionSide) as an identifier to differentiate them.

Thanks ishuen, the problem is that the response from this endpoint doesn’t have a timestamp or something that really identifies a specific position, and I use gradient techniques where I use the same volume, amount etc. So it would be quite difficult to use this endpoint. The only solution I see is to manage the position ids locally using a cache.

Hello

Can you help with this concept ?
It is at API NEW ORDER TRADE and order type TRAILING STOP :

Lowest price ( where get this )
Rebound rate

To activate a trailing stop order, 2 conditions need to be fulfilled.

A buy trailing stop order will be placed if the following conditions are met:

  • Activation Price ≥ Lowest Price
  • Rebound Rate ≥ Callback Rate

A sell trailing stop order will be placed if the following conditions are met:

  • Activation Price ≤ Highest Price
  • Rebound Rate ≥ Callback Rate

The concept used in positions is not the same as the one I use in Forex and that left me a little confused. If I open 2 orders for the same symbol with different entry prices and different volumes it will create a position with the average price and the sum of the volumes. My question is, if you want to reduce a position, in the case of the smaller volume and which has a lower price, it would just send an opposite positionSide, but what value would it use to reach the profit?

Hi. Please take a look at this guide, this can be helpful for you, especially the following topics:

Thank you, I will do that.

could you find the id of each position? I need to do something similar to what you wanted to do

Positions are unique to the user based on symbol and positionSide. You can use the Position Information endpoint mentioned previously in this thread.