I have a little problem, I use the [https://fapi.binance.com](https://fapi.binance.com) base API for the Binance Futures, we have a signal to open Long position on BTCUSDT at 16485.853 entry target, and place 5 Take Profits orders at 16733.087, 16897.945, 17062.803, 17310.092, 17474.948, 17722.235 and Stop Loss at 50% with Leverage 20x. I collect the tickSize for BTCUSDT is ‘tickSize’: ‘0.10’ that means for the price parameter we can add after the comma just 1 decimal, for example for the entry target 16485.853 we can set the price 16485.8. I collect the minQty for BTCUSDT is ‘minQty’: ‘0.001’ that means for the quantity parameter we can add after the comma just 3 decimals, for example if i want to buy BTCUSDT for 30$ with leverage 20x, the quantity is equal to 30 \* 20 / 16485.853 = 0.0363948410798034 and we set the quantity parameter to 0.036.

So, I start with 30$ at leverage 20x, I open a Long position on BTCUSDT at 16485.853 (16485.8 after converted with tickSize) that means i receive 0.0363948410798034 (0.036 after converted with minQty) quantity, this is the json for payload on the /fapi/v1/order endpoint:

open\_position = {
“symbol”: ‘BTCUSDT’,
“side”: ‘BUY’,
“positionSide”: ‘LONG’,
“type”: “LIMIT”,
“timeInForce”: “GTC”,
“quantity”: ‘0.036’,
“price”: ‘16485.8’
  }

After that I put the 5 Take Profits orders and I want each Take Profit Order to have 20% of the quantity so let’s give example of the first Take Profit, we have 0.036 / 5 = 0.0072 (0.007 after converted with minQty) for each of the Take Profit Order at 16733.087 (16733.0 after converted to tickSize). For example:

take\_profit = {
“symbol”: ‘BTCUSDT’,
“side”: ‘SELL’,
“positionSide”: ‘LONG’,
“type”: ‘TAKE\_PROFIT’,
“quantity”: ‘0.007’,
“stopPrice”: ‘16733.0’,
“price”: ‘16733.0’
}

And the rest of 4 Take Profits will be with the same quantity at their price.

After that I put the Stop Loss at 50% so, we have to set the stopPrice and price parameters, for that I use the entry target 16485.853 \* (1 – the stop loss percent 50% for that we have 0.5 / leverage 20x). 16485.853 \* (1 – 0.5 / 20) = 16073.706675 ( 16073.7 converted with the tickSize). For example:

stop\_loss = {
“symbol”: ‘BTCUSDT’,
“side”: ‘SELL’,
“type”: “STOP”,
“positionSide”: ‘LONG’,
“quantity”: ‘0.036’,
“stopPrice”:’16073.7′,
“price”: ‘16073.7’
 }

And now my problem is :

Why after all the 5 Take Profit Orders completed I still have the Stop Loss Order active and the BTCUSDT position active? I think because:

0.036 / 5 take profits = 0.0072 quantity per take profit but we can use just 3 decimals and we set 0.007 quantity per take profit but here we remain 0.0002 quantity for each of take profit in total we have 0.0010 quantity remaining in the air and for that reason we still have the position opened because we still have 0.0010 quantity there and also the Stop Loss is still there.

And also in the other case if the Stop Loss is executed, the position is closed because i set the quantity for the Stop Loss same with the position quantity but the 5 Take Profits is still there active.

Why after all the Take Profits executed doesn’t close the position and the Stop Loss order? And vice versa after the Stop Loss executed the position closed and we still have the Take Profits?

How can I solve this problem?

Thank you verry much, Anonymous Billionaires!


➔ Visit Binance now and start trading

2 Comments

  1. BinanceCSHelp on 21. January 2023 at 20:43

    Hello there!
    To check your situation with our relevant team, please, kindly open a live chat at [https://www.binance.com/en/chat](https://www.binance.com/en/chat)
    If you have already opened one, please, share with us the Case ID, so we could assign an agent for you.
    VG

     


  2. TheKrzyk on 21. January 2023 at 20:43

    In the first paragraph you say you “place 5 take profits orders at” and then list 6 values. Are you placing one too many?