When trying to place a buy or sell order with the python-binance api I got the following error:
APIError(code=-1013): Filter failure: LOT_SIZE.
Now I've seen at iceberg_parts that this means there is probably something wrong with my buying or selling quantity. I've tried to increase the quantity by a factor 10 but this only gives me another related error:
APIError(code=-1013): Filter failure: MIN_NOTIONAL.
Here's some of my code:
diff = current_price - prev_price
if diff <= 0.0001:
order = client.order_market_buy(symbol = market , quantity = '0.0001')
print('buy order')
if diff >= 0.00040:
order = client.order_market_sell(symbol =market, quantity ='0.0001')
print('sell order')
Do you know how to fix this?
Connect to Binance Client Using Python To connect to the client just define your API and secret key variable and execute the client function. To verify that your keys are correct and that you're connected to Binance, execute this function that will ping the server.
There are two options to do this: use a python package called python-binance. Use the python requests library to get data from binance.
The Binance API allows algorithmic traders to automate their trading by plugging into the Binance servers using Python or a variety of other programming languages.
Binance API is a method that allows you to connect to the Binance servers using several programming languages. With it, you can automate your trading and make HTTP requests to send and receive data. Here we access Binance API using Python with requests module.
This error appears because you are trying to create an order with a quantity lower than the minimun required.
You can access the minimun required of a specific pair with:
info = client.get_symbol_info('ETHUSDT')
print(info)
Output a dictionary with information about that pair. Now you can access the minimun quantity required with:
print(info['filters'][2]['minQty'])
# 0.00001
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With