I am trying to open order on binance but i always getting
binance.exceptions.BinanceAPIException: APIError(code=-1111): Precision is over the maximum defined for this asset.
I searched it and found solution:
def get_ticksize(symbol):
info = client.futures_exchange_info()
for item in info['symbols']:
if(item['symbol'] == symbol):
for f in item['filters']:
if f['filterType'] == 'PRICE_FILTER':
return f['tickSize']
tick = get_ticksize(symbol)
print('tick: ' + tick)
price = round_step_size(float(price), float(tick))
stopl = round_step_size(float(stopl), float(tick))
takep = round_step_size(float(takep), float(tick))
buyorder = client.futures_create_order(symbol=symbol, side=side, type="LIMIT", quantity=q, price=price, timeInForce="GTC")
stop = client.futures_create_order(symbol=symbol, side="SELL", type="STOP_MARKET", stopPrice=stopl, closePosition="true")
take = client.futures_create_order(symbol=symbol, side="SELL", type="TAKE_PROFIT_MARKET", stopPrice=takep, closePosition="true")
but i still getting this error. I made printing all prices and it is very strange:
tick: 0.010
BUY EGLDUSDT 51.46 50.43 55.57 1.92
All price rounded to tick but i still getting this error.