Category : binance

Here is my code. from binance.client import Client client = Client(api_key,secret_key) print(client.get_account()) An it throws the exception. BinanceAPIException: APIError(code=-1021): Timestamp for this request is outside of the recvWindow. I thought my system time is different so I used os.system(‘tzutil /s UTC’) to change to UTC (Binance server time) but exception still persist. Also I tried ..

Read more

I’m trying to get the daily data from all BUSD and USDT pairs from Binance over the past 2 years. I have created 2 lists of BUSD and USDT pairs like this: busd_list = ["BTCBUSD","ETHBUSD","BNBBUSD"…] Then for each element of this list I want to execute the function below: def klines_2_dataframe(ticker): new_df = pd.DataFrame(client.get_historical_klines(ticker,"1d","1 Jan, ..

Read more

I need to post multiple symbols to future binance api Now: self.names = [‘BTCUSDT’, ‘ETHUSDT’,…] for name in self.names: n = name + "USDT" data = requests.get(f"https://fapi.binance.com/fapi/v1/premiumIndex?symbol={n}").json() print(data) response: #BINANCE {‘symbol’: ‘STMXUSDT’, ‘markPrice’: ‘0.01877000’, ‘indexPrice’: ‘0.01877479’, ‘estimatedSettlePrice’: ‘0.01878688’, ‘lastFundingRate’: ‘0.00010000’, ‘interestRate’: ‘0.00010000’, ‘nextFundingTime’: 1642320000000, ‘time’: 1642316672003} Source: Python..

Read more

i try to discover the binance api and i can’t buy some crypto, i followed a tutorial documentation and did this inside my function: buy_order = client.create_test_order(symbol=’BATUSDT’, side=’BUY’, type=’MARKET’, quantity=20) and it doesn’t work,it do nothing. When i change my symbol: buy_order = client.create_test_order(symbol=’Test’, side=’BUY’, type=’MARKET’, quantity=20) it gives me an error, same when i ..

Read more

When creating a buy order, I’m using try-except block to catch an error like the following. test_buy = client.create_test_order(symbol=’ETHUSDT’, side=’BUY’, type=’MARKET’, quantity=3.1031) try: buy_limit = client.create_order(symbol=’ETHUSDT’, side=’BUY’, type=’MARKET’, quantity=3.1031) except Exception as e: print(e) I added test_buy just because [python-binance API][1] documentation said so. But why do we need to create a test order?. Is ..

Read more

this always give error code 1022 how can I solve this? try: Ordenes =client.futures_get_order(symbol=symbolo,orderIdList=mylista1) except Exception as e: print(e) client = Client(config.API_KEY, config.API_SECRET, tld=’com’) continue try: Orders =client.futures_get_open_orders(symbol=symbolo) except Exception as e: print(e) client = Client(config.API_KEY, config.API_SECRET, tld=’com’) continue while len(Ordenes)!=0: print("hay ordenes") print(Ordenes) if len(Orders)!=0: print("hay ordenes abiertas") print(Orders) else: client.futures_cancel_all_open_orders(symbol=symbolo) else: print("no hay ..

Read more

I’m not able to place the below order: symbolTicker = ‘SHIBUSDT’ orderPriceBuy = 0.00002650 orderPriceSell = 0.00002700 Code: buyOrder = client.create_order( symbol=symbolTicker, side=SIDE_BUY, type=ORDER_TYPE_LIMIT, timeInForce=TIME_IN_FORCE_GTC, quantity=orderQuantityBuy, price=orderPriceBuy) Error: raise BinanceAPIException(response, response.status_code, response.text) binance.exceptions.BinanceAPIException: APIError(code=-1100): Illegal characters found in parameter ‘price’; legal range is ‘^([0-9]{1,20})(.[0-9]{1,20})?$’. What seems to be wrong? Source: Python..

Read more