Error in using quoteOrderQty to Place a short order in future market using binance api and python

36 Views Asked by At

I write the following code to place a short order in future market and sell a specific currency ('symbol') such that I receive the specific amount of USDT (amount).

from binance.client import Client
api_key = '...'
api_secret = '...'
client = Client(api_key, api_secret)
short_order = self.client.futures_create_order(symbol=symbol, side='SELL', type="MARKET", quoteOrderQty=amount)

however, this casue the following error: APIError(code=-1102): Mandatory parameter 'quantity' was not sent, was empty/null, or malformed.

As I want to get the specific amount of USDT through this order, why the argument 'quantity' should be passed and what should its value be?

How can I edit this code to place a sell/buy order in future market to get/spend specific amount of USDT?

I also passed None for quantity to the function (quantity=None), but it also caused another error.

Do you have any idea about this issue?

thank you.

0

There are 0 best solutions below