sammchardy / python-binance

Binance Exchange API python implementation for automated trading
https://python-binance.readthedocs.io/en/latest/
MIT License
5.88k stars 2.2k forks source link

How to set quantity ? #1266

Open bmw7 opened 1 year ago

bmw7 commented 1 year ago

I use the following codes to take profit market

client.futures_create_order(symbol='ETHUSDT', side='SELL', positionSide='LONG', type='TAKE_PROFIT_MARKET', stopPrice=1800, closePosition='true')

BUT I cannot set the quantity. How to set quantity ? thanks!

halfelf commented 1 year ago

I believe binance has provided an explict instruction in document about this:

STOP_MARKET, TAKE_PROFIT_MARKET with closePosition=true:

Follow the same rules for condition orders.
If triggered,close all current long position( if SELL) or current short position( if BUY).
Cannot be used with quantity paremeter
Cannot be used with reduceOnly parameter
In Hedge Mode,cannot be used with BUY orders in LONG position side. and cannot be used with SELL orders in SHORT position side