Is sideEffectType=“AUTO_REPAY” compulsory for closing a Binance margin order?

Viewed 574

I Have a simple Binance Margin_Buy market order in the following form:

order_result = client.create_margin_order(
        symbol=TRADE_SYMBOL, 
        side=SIDE_BUY, 
        type=ORDER_TYPE_MARKET, 
        timeInForce=TIME_IN_FORCE_GTC, 
        newClientOrderId="myOrder1",
        sideEffectType=MARGIN_BUY, 
        quantity=buy_quantity, 
        price=buy_price)

After the order is executed and filled, do I have to close it and repay automatically by sending a second similar order to the Binance API, e.g.

order_result = client.create_margin_order(
        symbol=TRADE_SYMBOL, 
        side=SIDE_BUY, 
        type=ORDER_TYPE_MARKET, 
        timeInForce=TIME_IN_FORCE_GTC,
        newClientOrderId="myOrder1" 
        sideEffectType=AUTO_REPAY)

OR the sideEffectType=AUTO_REPAY is inclusive of the MARGIN_BUY and can complete both a Buy and Sell order and automatically close the position and repay to Binance, i.e. something like this:

order_result = client.create_margin_order(
        symbol=TRADE_SYMBOL, 
        side=SIDE_BUY, 
        type=ORDER_TYPE_MARKET, 
        timeInForce=TIME_IN_FORCE_GTC,
        newClientOrderId="myOrder1" 
        sideEffectType=AUTO_REPAY
        quantity=buy_quantity, 
        price=buy_price)

Which precise combination or single option is the best choice under given conditions? Thanks in advance.

0 Answers
Related