BINANCE API OTOCO ORDERS

I tried to place an OTOCO order with python binance connector I got an error

params = {
  "symbol": "BTCUSDT",
  "workingSide": "BUY",
  "workingType": "LIMIT",
  "workingPrice": "80000",
  "workingQuantity": "0.0015",
  "workingTimeInForce": "GTC",
  "pendingSide": "SELL",
  "pendingQuantity": "0.0015",
  "pendingAbovePrice": "90000",
  "pendingAboveType": "LIMIT_MAKER",
  "pendingBelowPrice": "70000",
  "pendingBelowStopPrice": "60000",
  "pendingBelowType": "STOP_LOSS_LIMIT",
  "pendingTimeInForce": "GTC",
}
try:
    response = client.new_otoco_order(**params)
    logging.info(response)
except ClientError as error:
    logging.error(
        "Found error. status: {}, error code: {}, error message: {}".format(
            error.status_code, error.error_code, error.error_message
        )
    )

output

ERROR root: Found error. status: 400, error code: -1104, error message: Not all sent parameters were read; read '15' parameter(s) but was sent '16'.

Hey,
you should replace pendingTimeInForce by pendingBelowTimeInForce.

Thank you so much, I followed the example in github project

examples/spot/trade/new_otoco_order.py

If you are referring to the following example, there is no use of pendingBelowType parameter.

From the documentation, it is stated that setting pendingBelowType to STOP_LOSS_LIMIT would change the following parameters to mandatory:

  • pendingBelowPrice
  • pendingBelowStopPrice and/or pendingBelowTrailingDelta
  • pendingBelowTimeInForce