How to set parameters on Stop-Limit (STOP_LOSS_LIMIT and/or TAKE_PROFIT_LIMIT) orders?

I am using the python-binance wrapper, and have a problem when trying to send in a Stop-Limit Order. What are the necessary parameters for these types of orders and what do they do?

I need to set a STOP_LOSS_LIMIT order on SPOT trading, I send it after a normal MARKET order which goes through fine. I do not need TAKE_PROFIT_LIMIT orders, but if I’m not mistaken they are the same type as the STOP_LOSS_LIMIT. (That type is Stop-Limit, as is written in the Binance UI.) Please correct me if I’m wrong.

Anyway, this is my code for STOP_LOSS_LIMIT orders:

order2 = client.create_order(
symbol='BTCUSDT',
side=SIDE_SELL,
type=ORDER_TYPE_STOP_LOSS_LIMIT,
TimeInForce=TIME_IN_FORCE_GTC,
stopPrice='33000',
price = '30000' )

After running this code I get the following error:

Not all sent parameters were read; read ‘7’ parameter(s) but was sent ‘8’.

I am obviously doing something fundamentally wrong, so please point me in the right direction. PLEASE do not link me the official documentation, there are no examples for these order types. I’d love it if someone could provide me with a concrete example for these types of orders. Does not matter if it is not for python, I just need to get a sense for what parameters I need and what do they do.

I look forward to your responses and thank you in advance!

As you might know, python-binance is not the official library, so I’m not very familiar with it, if you have interest you can try https://github.com/binance/binance-connector-python.

Now for the STOP_LOSS_LIMIT, the required parameters are:
symbol, side, type, timeInForce, quantity, price and stopPrice
(as stated in https://binance-docs.github.io/apidocs/spot/en/#new-order-trade)

So it might be related with not sending “quantity”.

I did not know about the official binance-connector-python library to be honest. Seems like I will have to check it out since I still cannot find a solution.
Thanks for taking the time to respond.

I was surprised and disappointed to see that binance-connector-python does not support Futures trading. Since I was planning on migrating my trades to Futures in the future anyway (no pun intended,) I decided to give it an early go.
If it’s allowed, I’ll answer my own question if anyone ever hits the same wall.

I conclude that Stop Loss/Take Profit orders do not work with Spot trading, either by design (which actually makes sense), or because of some unknown bugs.

Once I switched to Futures, it all worked out. This is how I set the leverage to 1:

client.futures_change_leverage(symbol='BNBUSDT', leverage=1) 

And this is how to set a stop loss order on existing Futures (buy) orders in python-binance

FuturesStopLoss =client.futures_create_order(
  symbol='BNBUSDT',
  type='STOP_MARKET',
  side='SELL',
  stopPrice=220,
  closePosition=True
  )

Changing side to BUY sets a stop loss order on existing sell orders.

Achieving the same in Spot trading is most likely possible by using Websocket streams and executing Market orders when desired prices are reached. However I did not want to go with that route.

The answer given by Marcel on this link worked for me.
Put Stop Loss Order on Binance Spot