0

I'm trying to open a 'long' position along with its stop loss and take profit orders.

The long position is successfully sent and placed. But whenever I try to create the TAKE_PROFIT order it throws an error

***binance.exceptions.BinanceAPIException: APIError(code=-1102): A mandatory parameter was not sent, was empty/null, or malformed.***

Code

position_order = client.futures_create_order(symbol='BTCUSDT', side='BUY', positionSide='BOTH', type=ORDER_TYPE_MARKET, quantity=0.05)
tp_order = client.futures_create_order(symbol='BTCUSDT', side='SELL', positionSide='BOTH', type='TAKE_PROFIT', quantity=0.05, stopPrice=26000.00, workingType='MARK_PRICE')

BINANCE CREATE NEW ORDER API DOCs https://binance-docs.github.io/apidocs/futures/en/#new-order-trade

Kaloyan Nikolov
  • 91
  • 1
  • 1
  • 10
  • 2
    Looks like you're missing the price parameter. From the [docs](https://binance-docs.github.io/apidocs/futures/en/#new-order-trade), if you scroll down: `Additional mandatory parameters based on type:` you'll see that TAKE_PROFIT requires `quantity`, `price` and `stopPrice` – EDG956 Aug 16 '22 at 20:24

0 Answers0