Open bmw7 opened 2 years ago
You can put sl/tp in the same request. Check this for information https://binance-docs.github.io/apidocs/futures/en/#new-order-trade
You can put sl/tp in the same request. Check this for information https://binance-docs.github.io/apidocs/futures/en/#new-order-trade
thanks! But I cannot find anything about sl/tp in the url you offered. What am I supposed to do? Could you help me with an application example, please?
SL - Stop loss TP - Take profit
check the "stopPrice" parameter
You can launch two different threads. That way it will not wait for the first command to finish to launch the second. Check out Process from multiprocessing library.
You can launch two different threads. That way it will not wait for the first command to finish to launch the second. Check out Process from multiprocessing library.
thanks! your answer is the solution !!! Could you kindly help me with this problem : https://github.com/sammchardy/python-binance/issues/1021
Multithreading is okay if there is no relation between first and second order , but , if you want to keep the second order to close the existing position then no use of threading
At the very same time, create two future orders, one for LONG, and the other for SHORT. I mean, the long and short order prices are the same. That is what I want.
If you run the code like this:
order1 = client.futures_create_order(symbol='ETHUSDT',side='SELL',type='MARKET',quantity=20)
order2 = client.futures_create_order(symbol='ETHUSDT',side='BUY',type='MARKET',quantity=20)
You'll find that the runtime is about 1 second! and the two orders' prices are very different! Because the runtime difference between the two lines of code is too long.
SO ,HOW to create 2 future orders at the same time?