Questions tagged [python-bybit]

26 questions
0
votes
0 answers

How to dynamically display each list object from a new line in PyQT6

I can't find a way for handleMessage() to display list objects from a new line with adding them to QLabel or QLineEdit. This is my first topic here, I immediately apologize if I framed it wrong from PyQt6 import QtCore, QtGui, QtWidgets class…
Mr.Framon
  • 21
  • 5
0
votes
0 answers

Error with closing opposite position with CCXT for bybit

i trying to make my CCXT bot to close old opposite trade with new trade coming from trading view but i have problem , it gives me this error: ccxt.base.errors.ExchangeError: bybit {"ret_code":130125,"ret_msg":"current position is zero, cannot fix…
0
votes
1 answer

I can't create an order on the exchange bybit using python (pybit)

i need help from pybit.usdt_perpetual import HTTP session_auth_ = HTTP( endpoint='https://api.bybit.com', api_key=api_key, api_secret=secret_key ) …
0
votes
1 answer

Bybit API (ErrCode: 10002)

Just trying to interact with the API, but I am getting a specific error when trying the simplest tasks such as getting the balance. Example Code import API_Login as apiLogin from pybit.usdt_perpetual import HTTP apiKey =…
Runner
  • 1
0
votes
1 answer

how to use 2 loops in 1 for loop

So I have a for loop that is placing orders for me on an exchange. The loop currently loops through a list of prices and places 1x order at each price. I also have a list of order sizes I would like to loop through but cant figure out how. I'm new…
Jack Mahon
  • 27
  • 6
0
votes
1 answer

Aggregate the levels of the orderbook

How can I aggregate the levels of the orderbook? Now it gets streamed every 0.05 tick but I need to stream this every 0.50 interval of price. How can I unite the various levels on the orderbook? This is the code: from time import sleep from pybit…
xabe
  • 1
0
votes
1 answer

cannot import name 'inverse_perpetual' from 'pybit'

cannot import inverse_perpetual from pybit: from pybit import inverse_perpetual Exception has occurred: ImportError cannot import name 'inverse_perpetual' from 'pybit'
amirgh
  • 1
  • 1
0
votes
1 answer

Failed to use websocket : websocket._exceptions.WebSocketConnectionClosedException: socket is already closed

Thank you for checking in! I've got a question about the websocket connection. Here's a websocket class I use to subscribe to an exchange's websocket, where the connection is established in self.connectWS_public() function. from datetime import…
0
votes
1 answer

Not able to update SL, TP using pybit sdk

I am trying to change the Stop_loss and take_profit for my open order. I am using this method to update my SL. When I run the code, I get this error: 2022-06-04:14:39:12,782 DEBUG [connectionpool.py:465] https://api-testnet.bybit.com:443 "POST…
0
votes
1 answer

How to extract all symbol and last_price from this json?

I tried like this, but it doesn't work. It worked with an other json file (https://www.binance.com/fapi/v1/ticker/price) I think it's because the beginning and end is different. There is some parts before the bracket and after. I got the error: …
One boy
  • 216
  • 1
  • 7
-1
votes
1 answer

How do i solve the qty problem i have on bybit api?

order_id=None symbol='BTCUSDT' order_type='Limit' side='Buy' price=26050.0 qty=0.002876 take_profit=26080.0 stop_loss=26040.0 time_in_force='GTC' reduce_only=None leverage=2 percentage=100 params error: Qty invalid (ErrCode: 10001) (ErrTime:…
1
2