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:
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!
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:
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.