Questions tagged [python-binance]

29 questions
0
votes
0 answers

Connect binance testnet futures user stream using python-binance

I'm going to connect binance testnet futures user stream data using python-binance library. I tried following code: async def update_crypto_user_websocket(): async_client = get_async_client(True) socket_manager =…
0
votes
0 answers

how to handle properly async websocket received messages?

I'm using the Python Binance library to connect to Binance and get real-time websockets. My final application is quite heavy and complex, using Pyqt5 for the GUI. Since I'm coding this application, I'm facing troubles with websocets. Latencies (like…
0
votes
1 answer

How to fix ModuleNotFoundError: No module named 'binance'?

From Jupyter Notebook I ran pip install binance. Running from binance.client import Client gives the error above. I have renamed the binance.py file as mentioned in similar questions however I'm still getting the error. I haven't installed for one…
Eli Bain
  • 23
  • 3
0
votes
0 answers

Certificate problem using websocket to connect to binance?

I am using python3 in visual studio. I have installed binance via pip3 install binance 1.10.15. When I use the following code: from binance.client import Client import time from binance import ThreadedWebsocketManager client = Client(api_key =…
0
votes
0 answers

Binance API: I can't fetch open order's stopLimit

Binance API: I can't fetch open order's stopLimit All I get is zero, i've tried different libraries for this but still doesnt work, i still get 0. i've tried different libraries and also tried raw request for this but still doesnt work, i still get…
Kun
  • 9
  • 1
0
votes
0 answers

Python Binance API get minute klinedata

CAN ANYONE HELP I am using python binance api I want to know how can add minute in 3rd and 4th argument like What i try: klines = client.get_historical_klines("ETHBTC", Client.KLINE_INTERVAL_30MINUTE, "01/01/2022", "02/02/2022") what i…
0
votes
0 answers

python-binance - how to listen for orders?

Is there a way to create a socket to be notified of order status changes? I'm looking for something similar to start_aggtrade_socket, where a socket can be created to listen for trades. But there does not seem to be anything similar for orders. It…
Martin Massera
  • 1,718
  • 1
  • 21
  • 47
-1
votes
1 answer

How to close a short or long position in binance futures?

I want to close a position, but when I use this code to close the position, it makes a new order, I don't want that. shortQty = float(positions[position]['origQty']) client.futures_create_order(symbol=str(tkr), side="SELL", type="MARKET",…
-1
votes
1 answer

BinanceAPIExceptionError: APIError(code=-2015): Invalid API-key, IP, or permissions for action

I tried every solution on the Internet in order to get rid of this error message but for some reason I can't solve it. client = Client(api_key=api_key, api_secret=secret_key,…
-1
votes
1 answer

Error when trying to use Binance api Client

I am located in California and I am trying to use the Binance API. When using this code: from binance.client import Client` client = Client(api`*`key, secret_key) this code produces the error: raise BinanceAPIException(response,…
Evank
  • 9
-1
votes
2 answers

The current price of the futures on the Binance exchange (in real time) in Python

This is my assignment: You need to write a Python code that will read the current price of the XRP/USDT futures on the Binance exchange in real time (as fast as possible). If the price falls by 1% from the maximum price in the last hour, the…
Alexey
  • 3
  • 2
-2
votes
1 answer

How to use a percentage of your account balance per trade? Binance-python

As far as I am aware the only way to create a new futures order is with client.futures_create_order(). The issue is this requires you to give it the exact amount of contracts you would like to buy. I am using BUSD to make all my trades, so I am…
Edog
  • 1
  • 1
-3
votes
1 answer

Connection to Binance Spot Testnet API

I'm working on a trading bot that actualy work and I would like to try it for a week on the Binance testnet. Despite all my research, i don't find a way to connect, I already read all the binance test net documentation I'm sure about my API's And…
1
2