I am trying to post orders with leverage for Binance Futures using the API. But there is something which I am not able to understand about how leverage works.
Here is what I am doing :
- Use “futures_change_margin_type” in order to change the margin type to ISOLATED
- Use “futures_change_leverage” in order to change the leverage to 5x (for instance)
- Use “futures_create_order” to place a LIMIT order
- Monitor the order status until it gets fullfilled
- Once it’s fullfiled place a LIMIT order in opposite side to take profits (SHORT if this was a LONG, LONG if this was a SHORT)
- Once this second order gets fullfilled, see the PNL
I thought by doing this only the PNL will be mutliplied by 5 but then I understood it does not work like that and I have to also increase the order quantity by 5 to achieve that. As I understand, the PNL is then multiplied by 5 in absolute terms (USDT) but not in relative terms (percentage).
Is this the right way of doing it?
Then I am wondering something else, what is the maximum loss which can occur with leverage ?
Let’s take an example, in the worst case scenario of losing the complete investment (100% loss) :
- Total margin balance is 10000 USDT
- With 1x leverage, we invest 500 USDT => loss is 500 USDT
- With 5x leverage, we invest 2500 USDT => loss is 2500 USDT
- With 20x leverage, we invest 20000 USDT => loss is 10000 USDT
Does it work like that by default with ISOLATED/5x ? Is there a possibility of some protection to restrict the margin balance used to 500 USDT in this example ?